What is the difference between String and StringBuffer

Showing Answers 1 - 8 of 8 Answers

saripella

  • Jun 9th, 2005
 

Strings are immutable whereas StringBuffers are mutable.

  Was this answer useful?  Yes

Ramesh

  • Aug 8th, 2005
 

String are once created, we can't modify it. Any such attempt will create a new string. In Stringbuffer one can can the insert,delete,append character after it is created. String values are resolved at compile time. So if we know the exact size of the string to be appended, better use String object. In StringBuffer values resolved at runtime, one can appened any number of String.only one StringBuffer is used to hold. No new object will be created. which is very fast

  Was this answer useful?  Yes

Rajesh Sakhamuri

  • Nov 2nd, 2005
 

String is the immutable we canot modify the string object, whereas StringBuffer is mutable,we can modify the stringobject.perfomance of string is more than the string buffer at runtime.

  Was this answer useful?  Yes

Rajesh Sakhamuri

  • Nov 2nd, 2005
 

Strings are immutable whereas StringBuffers are mutable.perfomance of string is more than the string buffer during the runtime.

  Was this answer useful?  Yes

Rajesh

  • Nov 2nd, 2005
 

String is the immutable we canot modify the string object, whereas StringBuffer is mutable,we can modify the stringobject.perfomance of string is more than the string buffer at runtime.By Rajesh

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions