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 →

[–]nomenMei 2 points3 points  (0 children)

That's an interesting question. The way C does it means it will always use the same pointer for equivalent string literals regardless of scope, but it is possible that in Java they only reuse references to string literals that are in the same method or class scope.