How does Java handle integer overflows and underflows

It uses those low order bytes of the result that can fit into the size of the type allowed bythe operation.

Showing Answers 1 - 7 of 7 Answers

ramu

  • Mar 10th, 2006
 

In java ,no overflow or underflow of integers happens i.e., the values wrap around.Adding 1 to the maximum int value results  in the minimum value

  Was this answer useful?  Yes

Sony V George

  • Apr 5th, 2007
 

In java there is no point of overflow and underflow, it was there in C. For avoiding that java introduces type casting.

Java will allow some more space from the defult space of primtive type.

  Was this answer useful?  Yes

sandy2789

  • Jan 12th, 2009
 

Difference  Between   Over  Flow  &  Under  Flow   (JAVA)
   
over  flow  = ex : array>  [0][1][2][3][4]   only  present  5  bracket   but   adding   extra  value  in  bracket

   
Under flow  =  ex : array>[ ][ ][ ][ ][ ]  if the   bracket  is   null that   time  delete  value

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions