

I think you’re fundamentally misunderstanding the above.
In your first example, you change an attribute of an object. In your case you called it .value but could just as well have been called .jacket.
In the second case you replaced one immutable object with another. You didn’t change the “value” attribute of 1002 to 1001. You replaced the entire object, 1002 with a new one: 1001.










Who’s killing them I wonder?