posted 19 years ago
HI All
In the following code why the last line's output is so
int k=Integer.MAX_VALUE;
System.out.println("Integer.MIN_VALUE \t" + Integer.MIN_VALUE);
System.out.println("Math.abs( k )\t" + Math.abs(k));
System.out.println("Math.abs( Integer.MIN_VALUE )\t" + Math.abs(Integer.MIN_VALUE));
output is:
Integer.MIN_VALUE -2147483648
Math.abs( k ) 2147483647
Math.abs( Integer.MIN_VALUE ) -2147483648
Thanks
kundan
SCJP1.4,SCBCD,SCEA,CNA
Failures are practice shoots for success.