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 the difference between comparator and comparable in java?
How do you clear a method in java?
Are registers volatile?
What languages are pass by reference?
What is string syntax?
Does sprintf add a null terminator?
What is sizeof in java?
What is the difference between @before and @beforeclass annotation?
what state does a thread enter when it terminates its processing? : Java thread
How many types of methods are there in java?
What is function declaration?
What is the driver class?
How to perform linear search in java?
What is difference in between java class and bean?
What is one third plus one third as a fraction?