CSC300 / CSC402: Integers Far from Zero [17/24] |
Integer x = 3000; Integer y = 3000; x=3000, y=3000 x==y : false Objects.equals(x,y) : true x.equals(y) : true |
Java is using Integer.valueOf(3000)
to box the integer. The boxed objects are distinct in memory.