String
=====
String are immutable object.Its value cannot be changed(constant).String object are readonly.If you create one instance of string and change the value of string then it create new instance.
String Buffer
=========
String Buffer is mutable.Its Value can be Changed.If you create one instance and append the text without creating a new instance
Example:
======
String
=====
String str=”welcome”;
str + = “to fordevs”;
String Buffer
=========
StringBuffer strbuff=new StringBuffer(“welcome”);
strbuff.append(“to fordevs”);
Both code give same output but Second approach much faster than first one.
Popularity: 6% [?]
Related posts:

May 22nd, 2010
Jaffar
Posted in 
