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 |
What is args length in java?
can we have virtual functions in java?
What is the primitive type byte?
How do you stop a thread in java?
What is diffrance between FINALIZE() & FINALLY ?
What are the advantages of assembly language?
Is simpledateformat safe to use in the multithreaded program?
What about abstract classes in java?
Explain JPA in Java.
What is the declaration statement?
What JNDI(Java Naming and Directory Interface) provides?
The class "Class" is belongs to which package?? a) java.lang b)java.lang.reflect c)java.util d)None