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
What is a byte array?
What is hashtable and explain features of hashtable?
what are the high-level thread states? : Java thread
Should a main method be compulsorily declared in all java classes?
Is java written in c?
What is use of static in java?
Explain the importance of thread scheduler in java?
What is increment in java?
What is an exception? difference between Checked and Unchecked exception in Java
What is the ==?
Can we restart a thread already started in java?
What do you mean by exception handling in Java?
Does java runtime require a license?
Is minecraft 1.15 out?
Explain about fail fast iterators in java?