Hi,
Is there any direct way to find, whether overflow occured in a computation, in Java. For eg., assume the following code segment:
here, overflow occured and 'c' wil have a wrong value, instead of 130, (since a byte can hold only upto +128). I just want to know is there any specific way to check whether overflow occured or not.
thanks,
madhes
Is there any direct way to find, whether overflow occured in a computation, in Java. For eg., assume the following code segment:
Code:
byte a = 10, b = 120, c = a + b;
thanks,
madhes