What are integer overflows and underflows and how to handle
them?
Answer Posted / ramesh kumar
byte b = (byte)250;
Here I assinged the value to b more than the positive range
of byte. So, It leads to overflow and we won't get any
error in compile time or run time.
But some unexpected value will be stored into b. i.e b = -
6. This will affect your logic.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between double and float variables in java?
What is variable length arguments in java?
what is instanceof operator used in java?
Differences between C and Java?
What are the super most classes for all the streams?
How do you create immutable object in java?
How will you load a specific locale?
Which of the following is not an isolation level in the JDBC
What happens if constructor is private?
What is difference between final and immutable?
What classes of exceptions may be thrown by a throw statement?
What happens if I remove static from main method?
What are keywords give examples?
How do you define a set in java?
How does hashset works in java?