What are integer overflows and underflows and how to handle
them?

Answer Posted / nirmala

If the specified value exceeds the range that will result
overflow.
similarly,
if the specified value below the range that will result in
underflow
ie
byte b=259;(butits rangeis(-127 to 128) totally 256
in this u will get overflow error.

Is This Answer Correct ?    26 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need singleton class?

728


What is an object in java and how is it created?

816


What is difference between static and abstract class?

738


What are the topics in core java?

781


What is flag in python?

794


How to create com object in Java?

842


How do I find and replace in word?

728


Is java owned by oracle?

757


What is difference between overloading and overriding in java?

729


Where are local variables stored?

715


Can you add null to a list java?

782


Explain the available thread states in a high-level?

720


What classes of exceptions may be caught by a catch clause in java programming?

919


what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread

892


What is the use of a copy constructor?

759