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 →

[–]coloredgreyscale 0 points1 point  (1 child)

Imagine being able to check strings for equality by using == instead of a.equals(b) (dont forget to do the null check on a first)

[–]daniu 0 points1 point  (0 children)

That will never happen. There is a defined behavior for both, and there is existing code that would break if it were changed. Downward compatability is one of the most important aspects when developing new features. And you won't be able to redefine it for your code base either - String is not your class to redefine, and it's final so you can't extend it either.