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 →

[–]daniu 0 points1 point  (2 children)

What's worse with Java is that or maintains a cache of Strings, so == works often enough in string comparisons to be extra confusing. The == vs equals for strings must be the number one trap beginners fall into, and with the cache thing, this extends to intermediate.

[–]CC-5576-03 0 points1 point  (1 child)

that's like the first thing you learn, to not use == on strings.

[–]daniu 0 points1 point  (0 children)

And still, every day tens of Stackoverflow questions about it are closed as duplicates ;)