When i invoke
System.out.println("print this line here");
is the String
"print this line here"
interned?
The class String has a native interning mechanism to look up every new String value (except for those instantiated by the explicit call of its constructor) in a pool of values, and create a String object of that value only if it doesn't find it in this pool.
I'm wondering how this works with String constants. So, every time i'm invoking this statement in a loop, is "print this line here" being interned-- looked up in the pool to see whether it's there ... ?
//======================
NOTE: this is similar to but different than my prev.Q here.
Stringobjects are immutable, all strings are constants."foo" != new String("foo").