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.
Example:-
StringBuffer str="Hello StringBuffer";
str.toUpper();
the above program output come like as-
HELLO STRINGBUFFER
it is only possible with StringBuffer not with the String class.
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.
Example:-
StringBuffer str="Hello StringBuffer";
str.toUpper();
the above program output come like as-
HELLO STRINGBUFFER
it is only possible with StringBuffer not with the String class.
{ 0 comments... read them below or add one }
Post a Comment