This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
If you use the special syntaxes for String the JVM will try to optimize by re-using Strings that already exist in the Pool. This is more efficient if there are duplicate strings. The special syntaxes include String s = "asfasfasd"; //directly naming String x = s + "sdfsd"; // concatenation If you make a String using the "new" operator an object will be created on the heap (where most objects live) even if there is a string object in the pool which matches it. See this thread from yesterday. http://www.javaranch.com/ubb/Forum33/HTML/003680.html
[This message has been edited by Cindy Glass (edited October 09, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara