Google News
logo
Java - Interview Questions
What is the difference between String and StringBuffer classes?
String class objects are immutable and hence their contents cannot be modified. StringBuffer class objects are mutable, so they can be modified. Moreover the methods that directly manipulate data of the object are not available in String class. Such methods are available in StringBuffer class.
Advertisement