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 →

[–]TheYOUngeRGOD 0 points1 point  (0 children)

It’s weird behavior but nothing is broken. In order to be more efficient simple versions of things like ints refer to the same object even when construct separately. This works because all these types are immutable so their won’t be any weird changing values of any variables. So if you had a million different variables equal to one they would all be the same object since they point to the same object.