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 consumer in java?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What are 5 boolean operators?
What is an 8 bit word?
What java ide should I use?
What is java literals?
How to find the given number is a prime number or not by getting input from the user
What are benefits of java?
What is the difference between the paint() and repaint() methods in java programming?
Which access specifier can be used with class ?
Give the difference between the println method and sqrt method?
Difference between a process and a program?
How can we make sure main() is the last thread to finish in java program?
What does snprintf return?
Can you pass by reference in java?