Can we add two byte variables and assign the result to a
byte variable ?
b=b1+b2 where b,b1,b2 are byte types
Answer Posted / m. abhishek
yes, but u require type casting because the the binary
operation in java should atleast returns Integer values
example :
byte a=12;
byte b=23;
// byte c=a+b; //Not OK,bcoz a+b is an int value
int c=(byte)a+b; // OK
Is This Answer Correct ? | 34 Yes | 7 No |
Post New Answer View All Answers
How many bytes is double?
What is java algorithm?
Why is method overloading not possible by changing the return type in java?
Can Exception handling we can handle multiple catch blocks?
What is a nested list?
What is the meaning of nullable?
Why is java so popular?
I want to persist data of objects for later use. What’s the best approach to do so?
How does java enable high performance?
What are multiple inheritances? Is it supported by java?
How do you escape a string?
What is map java?
What is difference between static and final?
What is the final blank variable?
What are the types of collections in java?