what is the main difference between string and stringbuffer?
can you explain it with program?
Answer Posted / divya
String class is used to manipulate character strings that
cannot be changed.Simply stated,objects of the String are
read only and immutable.
StringBuffer class is used to represent characters that can
be modified.
Ex:Sting str=new String("core");
str +="Java";
StringBuffer str=new StringBuffer("core");
str.append("Java");
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is meant by interface?
What is a modifier?
Is overriding possible in java?
Explain about main() method in java ?
What's a method in programming?
What is difference between == equals () and compareto () method?
What is a short in java?
Can a private method be declared as static?
Difference between this() and super() in java ?
What is the advantage of preparedstatement over statement?
What is space character in java?
What is the purpose of encapsulation?
What is the memory leak in java?
What invokes a thread's run() method in java programming?
Can java arraylist hold different types?