hi,
please, I would be clear that we can clearly explain the sentence below with examples.
Please note that Strings computed by concatenation at compile time, will be referred by String Pool during execution. Compile time String concatenation happens when both of the operands are compile time constants, such as literal, final variable etc.
Whereas, Strings computed by concatenation at run time (if the resultant expression is not constant expression) are newly created and therefore distinct
.
Understanding the management of characters in
Java enormously enormous. When is the
String Pool used? When is a string newly created?
thanks