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 if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
Name the class that used to read objects directly from a stream?
What is the difference between this() and super() in java?
3) Suppose you are a very rich person, having 50 rooms and you have lost the key for one of the room's. How effectively you can find this key? (Qs2 and Qs3 are related)
What is the purpose of object oriented programming?
What is lambda programming?
which class is the wait() method defined in? : Java thread
Why should we use singleton pattern instead of static class?
What is java util concurrentmodificationexception?
what is the use of private constructor in core java?
3 Answers OnMobile, Satyam, Yash Technologies,
why use interface? if interface declear a method implement in class. why direct implement method in class
Why only one Class is public in one file? Explain in details. Thanks in Advance.