Tuesday, November 29, 2011

What is the difference between String and StringBuffer? Which is better to use in project?

When a String is created, it is not destroyed. It remains in the pool of memory and whenever that string is referred, the JVM searches for the String from the string pool of memory and gets the relevant data. So as such String is expensive operation.
Category:Java Interview Questions

No comments:

Post a Comment