Difference between String and String Buffer?

Answers were Sorted based on User's Feedback



Difference between String and String Buffer?..

Answer / janet

1. String objects are constants and immutable where as
StringBuffer objects are not.
2.String class supports constant strings where as
StringBuffer class supports growable and modifiable strings.

Is This Answer Correct ?    13 Yes 0 No

Difference between String and String Buffer?..

Answer / sumati

String is immutable
String buffer is mutable

Ex String str = "abc";
str = "new String";
this will creat new memory location and stores "new String"

but in String buffer
StringBuffer strBuf = "abc";
strBuf = "new String"

it will overwrite in same memory location

Is This Answer Correct ?    13 Yes 0 No

Difference between String and String Buffer?..

Answer / ravikiran(aptech mumbai)

string is immutable
string buffer is mutable

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More Core Java Interview Questions

how exactly garbage collection take place?

4 Answers  


Explain notify() method of object class ?

0 Answers  


What are inbuilt functions?

0 Answers  


What is the collections api in java programming?

0 Answers  


What is a vararg?

0 Answers  






How do you define a parameter?

0 Answers  


What is the flag in java?

0 Answers  


how to deploy tomcatserver to weblogic server? write d following steps?

0 Answers  


What is a function in java?

0 Answers  


how a marker interface gets its functionality and when we implements a marker interface how it got invoked

3 Answers   Mind Tree,


What is arrays sort in java?

0 Answers  


What is derived datatype?

0 Answers  


Categories