package boxing; public class IntegerComparisons { public static void main(String[] args) { Integer i1 = Integer.valueOf(1000000); Integer i2 = Integer.valueOf(1000000); System.out.println(i1 == i2); // as long as not cached ;-) System.out.println(i1.equals(i2)); } } /* Session-Log: false true */