Good day. I read about autopacking in Java and the question appeared:
Integer i0 = 100; Integer i1 = new Integer(100); System.out.println(i0 == i1); Why is the result false? After all, if you do this:
Integer i0 = 100; Integer i1 = 100; System.out.println(i0 == i1); That result will be true. Although in the first example the line:
Integer i1 = new Integer(100); Where the value of 100 is also packed, but only manually, and not automatically (as in the second example) into an object of type Integer.