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 void method java?
Can we define a package statement after the import statement in java?
Which number is denoted by leading zero in java?
What is a vararg?
How do you join strings in java?
Difference between overriding and overloading in java?
What is object english?
What are anonymous inner classes?
What is runtime locatable code?
What is an empty list in java?
What is the purpose of main function in java?
Why unicode is important?
What is an iterator java?
What is tochararray in java?
What is the main use of generics in java?