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
Can we override private method in java?
Define reflection.
Can extern variables be initialized?
Explain about interrupt() method of thread class ?
What is compareto?
What are examples of modifiers?
What is the difference between call by reference and call by pointer?
Can we extend immutable class?
What is difference between array and arraylist in java?
How to store image in arraylist in java?
What is a method signature java?
Explain inheritance in java?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
What are the advantages of exception handling?
What are the differences between the constructors and methods?