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
Is a char always 1 byte?
What is data movement?
What is a string what operation can be performed out with the help of a string?
Can we overload the methods by making them static?
When parseint method can be used?
How to instantiate static nested classes in java?
What do you mean by object?
Give the hierarchy of inputstream and outputstream classes.
Why java does not support pointers?
What will be the output of round(3.7) and ceil(3.7)?
What is the difference between a choice and a list?
What are different type of exceptions in java?
What do you mean by stream pipelining in java 8?
Which are the two subclasses under exception class?
Can java run on google chrome?