CSC300 / CSC402: Integers Close to Zero [16/24] |
Integer x = 30; Integer y = 30; x=30, y=30 x==y : true Objects.equals(x,y) : true x.equals(y) : true |
This is like what Java does with string interning -- boxed integers close to 0 are given a canonical representation.
Again, this is for efficiency.