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
Explain restrictions for using anonymous inner classes?
Is assembly language a low level language?
Write a program to print count of empty strings in java 8?
What is the finalize method do?
How to print an arraylist in java?
Can inner class be public in java?
what is the difference between the methods sleep() and wait()? : Java thread
What are the topics in advance java?
Which package is imported by default?
Which language is java?
What comes to mind when someone mentions a shallow copy in java?
what is optional in java 8?
What is difference between module and function?
What is thread safe in java?
What are checked exceptions?