Difference between String and String Buffer?
Answers were Sorted based on User's Feedback
Answer / janet
1. String objects are constants and immutable where as
StringBuffer objects are not.
2.String class supports constant strings where as
StringBuffer class supports growable and modifiable strings.
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / 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 |
Answer / ravikiran(aptech mumbai)
string is immutable
string buffer is mutable
| Is This Answer Correct ? | 7 Yes | 0 No |
Why does java have two ways to create child threads?
Is array dynamic in java?
What is compareto?
what is the full form of java
IS method overriding is Duplication of Methods?
What is garbage collection in Java, and how can it be used ?
32 Answers Accenture, HCL, Infosys, Sara, SITS, TCS, Wipro,
What are legal modifiers that we can use to declare an inner class?
How do I enable java in safari?
Why method overloading and method overriding required in java?
What is the purpose of having the concept of overloading?
How to sort an array from smallest to largest java?
What is early binding and late binding in java?