Java Wrapper classes are supposed to be immutable. This means that once an object is being created, e.g.,
Integer i = new Integer(5);
its
The reason i = 6 works is that auto-boxing is intercepting and turning it into i = new Integer(6). Thus as @Peter said, you are now pointing at a new object.
i = 6
i = new Integer(6)