Interning the empty string (or any other string for that matter) does not give you any guarantee that subsequent instance will use the same object unless you intern them too.
The contract is that 2 Strings reference the same object (and thus are ==
) if they are equals()
and have both been interned.
Besides interning has a cost, each intern()
implies a search in the pool.