Although it's an old method/behavior, this feature is not very popular.
Java String has
.intern() that points directly to String constant pool (pool of pointers, as C pointer) and can be used
== instead .
equals()(and it's faster)
More info:
https://www.geeksforgeeks.org/interning-of-string/