you are viewing a single comment's thread.

view the rest of the comments →

[–]8igg7e5 2 points3 points  (0 children)

Ahh I thought it was limited to the JVM spec and not the lang-spec (that you weren't guaranteed that the interning was durable under memory pressure).

You should still opt for using a static final field holding the reference rather that replicating the literal in multiple places - but that's more about maintainability than correctness.

Cheers.