Difference between the String and StringBuffer classes?

Answers were Sorted based on User's Feedback



Difference between the String and StringBuffer classes?..

Answer / anitha

yes, String is a immutable that means once the string
object is created it cannot be changed.

String Buffer: it is a mutable,this object is changed if we
make any modifications.

Is This Answer Correct ?    8 Yes 0 No

Difference between the String and StringBuffer classes?..

Answer / sathya

String class is immutable i.e oncle created the value
cannot chage.

Stringbuffer class is mutable.The value can change.

Is This Answer Correct ?    5 Yes 0 No

Difference between the String and StringBuffer classes?..

Answer / latha

String is immutable and StringBuffer is mutable as most of
we know. In performance, StringBuffer is faster than the
String while performing simple concatenations.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Core Java Interview Questions

If your team member writes code with lots of static variables and static methods, will it cause any side effects?

3 Answers   KPIT,


What does you mean in math?

0 Answers  


What are serialization and deserialization?

0 Answers  


What is join () in java?

0 Answers  


how to print the below in java?thanks in advance.... * * * * * * * *

3 Answers  






Explain wrapper classes in java?

0 Answers  


What are the override methods in Object class?

2 Answers   Tech Mahindra, Wipro,


What is Hash Code in Java?

6 Answers   Cognizant,


Why is stringbuffer thread safe?

0 Answers  


What is left shift and right shift?

1 Answers  


how jvm allocates memory for stack?

1 Answers   HP, Ramco,


What is memory leak and how does java handle it?

0 Answers  


Categories