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
Can we create more than one object singleton class?
Can we use switch statement with strings?
What type of language is java?
How many bytes is a string?
What is module in project?
Can I declare class as static or private?
What is class forname?
What is the difference between integer parseint and integer valueof?
Can main() method in java can return any data?
What are heterogeneous objects?
What is consumer interface?
Explain the scope of a variable.
Can we have return statement in finally clause? What will happen?
What is java lang string?
What is Garbage Collection in Java