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 does java final mean?
What is a null point?
Wha is the output from system.out.println(“hello”+null); ?
Can you use abstract and final both with a method?
Can we write a class without main method in java?
Describe the term diamond problem.
How many static init can you have?
What is protected access modifier?
What is meant by 'bit masking' in java?
What are thread local variables?
What is literal example?
What is meant by class and object in java?
How to create a custom exception?
What are the 5 types of research methods?
Can a method be overloaded based on different return type but same argument type?