Login
Forgot your password?
JavaMad logo
Popular Questions
Java Puzzles Interview Questions
 
what will be the out put
public class EasyMath {
public static void main(String arg[]){
System.out.println( 1234 + 432l);
System.out.println( 0123 + 3210);
}
}

July 31 2012
 
1666
3293

July 31 2012
 
it will be output
5555
3293

July 31 2012
 
Provide the reason why the below output differs? Integer a=10; Integer b=10; System.out.println(a==b); Integer k=1000; Integer j=1000; System.out.println(k==j);

July 31 2012
 

value will not differ in both cases ,it  will print 

false


July 31 2012
 
java 5 autoboxing concept user the value from pool if it moving to warpper class. For more details check the below link.



http://www.javablogging.com/autoboxing-pitfalls-when-comparing-numbers-with/

July 31 2012
 
Java handleIntegers in the -128 to 127 range ,
so not only in case of one thousand if u use 128 in Integer then u got false

July 31 2012
 
Ads