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 a line break?
Explain differences between collection api and stream api?
Does importing a package imports its sub-packages as well in java?
What is the difference between char and char *?
What does index mean in java?
What is variable explain?
Difference between vector and arraylist.
What is the full form of jpeg?
Why java is called not pure object oriented language?
Difference between throw and throws?
Explain the concept of proper inheritance?
What is difference between wait and notify in java?
What is the basic concept of java?
What does indexof return in java?
What is Classloader in Java?