What is the difference between String and StringBuffer class ?

Strings are immutable (constant), their values cannot be changed after they are created. StringBuffer supports mutable objects.

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.