Answer Posted / sumati
String is immutable
String buffer is mutable
Ex String str = "abc";
str = "new String";
this will creat new memory location and stores "new String"
but in String buffer
StringBuffer strBuf = "abc";
strBuf = "new String"
it will overwrite in same memory location
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
what is the difference between a threads start() and run() methods? : Java thread
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
What is the difference between java applets and applications?
What is the numeric promotion?
What is a lambda expression ? What's its use ?
What is the concept of multithreading?
What is the difference between public, private, protected, and friend access?
Are floats faster than doubles?
Is space a char?
Explain when classnotfoundexception will be raised ?
Can a private method of a superclass be declared within a subclass?
Explain public static void main(string args[]).
What are the difference between composition and inheritance in java?
What is byte data type?
What is string builder in java?