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 |
Can I overload to string method
Functionality of JVM?
What is quick sort in java?
Does constructor creates the object ?
what is difference between throw and throws in exception?
class A { private int i; } class B extends A { private int i; } if I create an object of B class what will be the memory of that object.
Can you explain the meaning of aggregation and composition
How can we find the sum of two linked lists using stack in java?
What are the parameters used in Connection pooling?
what is Assertion?
What are some examples of variable costs?
When to use runnable interface vs thread class in java?