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
Explain the init method?
What are the actions that can occur when a thread enters blocked state?
What is a “stateless” protocol ?
What is overloading and overriding in java?
How do you escape in java?
What the difference is between execute, execute Query, execute Update?
What is a type parameter in java?
What is the difference between method overriding and overloading?
What is locale?
Explain about map interface in java?
What is a "pure virtual" member function?
Can we use synchronized block for primitives?
How do you define a singleton class?
What are the properties of thread?
What are loops in java?