Why is string buffer better than string ?



Why is string buffer better than string ?..

Answer / Bhumika Kansal

"StringBuffer in Java is mutable, meaning it can be changed after creation. In contrast, String is immutable and cannot be modified once created. This makes StringBuffer more efficient when dealing with multiple modifications of a single string."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is a list in java?

1 Answers  


What is instance means in java?

1 Answers  


explain the clone method and clonable interface

1 Answers  


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

1 Answers  


How do u provide security in java

3 Answers  


What do you understand by an io stream?

1 Answers  


how to handle http request in struts

2 Answers   Polaris,


How does class forname work in java?

1 Answers  


What is the final keyword?

1 Answers  


What are different ways of object creation in java ?

1 Answers  


Discuss 2D arrays.

1 Answers   Amdocs,


Is call by reference possible in java?

1 Answers  


Categories