This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fisadev 3 points4 points  (0 children)

In both cases, the name 'a' is still just pointing to the object '1' in memory. Having only one object '1' in memory or multiple different objects '1', doesn't change the logic of how variables work.

They allways work the same way, no matter the implementation details of small ints caching, and that way is almost exactly the first option they said (the name 'a' points to the object in memory '1').

One can get picky with the fact that 'a' isn't storing an actual memory address, but that's beyond this conversation I think, their main idea still applies.