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
Is arraylist zero based?
What is integer valueof?
What is assembly language?
What is the advantage of functional interface in java 8?
What are anonymous inner classes?
What is the internal implementation of set in java?
what is meant by encapsulation?
Explain thread life cycle in java?
What is javac used for?
What is flag in java?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
What is a dot notation?
Does java have extension methods?
What does it mean that strings are immutable?
Define locale.