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 / guest
yes.But you have to cast that variable before adding.
eg:
byte b=(byte)b1+(byte)b2
| Is This Answer Correct ? | 7 Yes | 35 No |
Post New Answer View All Answers
What is the purpose of static methods and variables?
What are the rules for variable declaration?
Why do people says “java is robust”?
What is the difference between actual and formal parameters?
How do constructors use this() and super()?
What if constructor is protected in java?
How to run a JAR file through command prompt?
What is difference between module and function?
What are the important features of Java 8 release?
Differentiate between vector and array list.
What does sprintf return?
What is a generic code?
When super keyword is used?
What are different data types?
What is lambda in java?