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 do you invoke a method?
Is special character in java?
What is the default value of local and global variables?
What is an infinite loop? How infinite loop is declared?
How we can declare a static variable?
What are the 4 versions of java?
What is bool mean?
Explain about public and private access specifiers?
How do you use equal in java?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
What is arraylist e?
What does s mean in regex?
What are the advantages of defining packages in java?
Why does java doesnt suuport unsigned values?
What is append function?