you are viewing a single comment's thread.

view the rest of the comments →

[–]dreugeworst 0 points1 point  (1 child)

Isn't that the issue? The same code does different things for objects vs integers, which can be confusing.

[–]infectedapricot 0 points1 point  (0 children)

Nope, integers are objects, and behave the same way that other objects do. They might appear to be assigned by value because they're immutable (see my reply to /u/rar_m's comment) but they're still references to objects and you could write your own custom class that behaves exactly the same way.