StringsBuffer Class in Java - Use of StringBuffer Class in Java

StringBuffer Class in Java:-

The StringBuffer Class is an alternative to the String Class. In General a StringBuffer can be used wherever a String class is used.

StringBuffer is more flexible then String class. You can add, insert or append new contents into a StringBuffer class object.However the value of a String object is fixed once the string is created.


StringBuffer str="Hello StringBuffer";

the above program output come like as-

it is only possible with StringBuffer not with the String class.

{ 0 comments... read them below or add one }

Post a Comment