3 ms·
> old, outdated info out there I'd love it if the JDK had a "learner mode" that disabled interned string literals. Then newbies experimenting with `assert(str1
by Terr_ 13y ago
> old, outdated info out there
I'd love it if the JDK had a "learner mode" that disabled interned string literals. Then newbies experimenting with `assert(str1 == str2)` wouldn't leap to false conclusions.
- lmm 13y ago== should never have been used for that method, which is very rarely what you want. The right thing is probably to deprecate == on nonprimitive types, replacing it with a longer name that's clearer about what it means.