What is difference between String & StringBuffer?
String class provides the immutable character
sequence whereas StringBuffer class objects are
mutable characters sequence. The StringBuffer is
faster than String when performing simple
String s=new String("Hello");
The String object s is still pointing to "Hello"
instead of "HELLO". Here a new string "HELLO" is
created but did not assinged to any reference
StringBuffer sb=new StringBuffer("Hello");
The StringBuffer object sb is now pointing to the
This is the main difference that string object
are immutable and string buffer objects are