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 multiple inheritance? Is it supported by java?
How do you reverse a list?
What does a boolean method return?
How many bits is size_t?
Explain the importance of join() method in thread class?
Can a static method be final?
What is derived datatype?
Can a final method be overloaded?
Explain reverse a linked list iterative solution in java?
How hashmap increases its size in java?
Can we override constructor?
why are there separate wait and sleep methods? : Java thread
What is a java predicate?
Is java pass by value or pass by reference?
How do you compare arrays in java?