Sat Aug 29, 2009 2:36 pm
public class BoxingTest {
public static void main(String args[])
{
// non auto boxing
Integer x = new Integer(10);
int y = x.intValue();
System.out.println("Y = "+y);
// auto boxing
Integer z = new Integer(43);
z++;
System.out.println("z = "+z);
Integer h = new Integer(44);
System.out.println("h = "+h);
// Comparing two refferences
System.out.println("z == h "+(h == z ));
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.