Is Integer Immutable
问题 I know this is probably very stupid, but a lot of places claim that the Integer class in Java is immutable, yet the following code: Integer a=3; Integer b=3; a+=b; System.out.println(a); Executes without any trouble giving the (expected) result 6. So effectively the value of a has changed. Doesn\'t that mean Integer is mutable? Secondary question and a little offtopic: \"Immutable classes do not need copy constructors\". Anyone care to explain why? 回答1: Immutable does not mean that a can