What is string & string buffer and why they are use?
string is immutable, when it is created, it can never change.
stringbuffer is mutable.
string doesn't contain append () method.
stringbuffer contain append () method.
string is a thread safe(every immutable object in java is thread safe).
stringbuffer is thread safe
String object is stored in the constant string pool.
stringbuffer object stored in heap.
String is immutable where as string buffer is mutable.
String implements comparable interface SB doesn't .