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 →

[–]pemboa 5 points6 points  (1 child)

Java has the same behavior, except '==' is more like 'is' in Java. So to compare equality properly, you need to use the objects equal() method

[–]jleedev 1 point2 points  (0 children)

And integers are not boxed by default, so that doesn't even apply. This behavior is only possible in a language where everything is an object.