Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Difference String and String Buffer

Answers were Sorted based on User's Feedback



Difference String and String Buffer ..

Answer / parameswaran

String is immutable object..we can't modified the value...
but string buffer is mutable object we can change.
>>It can increase or decrease the size dynamically..
>>It contains Max 255 characters..

Warm & Regards
Parames(PRC)

Thanjavur

Is This Answer Correct ?    6 Yes 0 No

Difference String and String Buffer ..

Answer / kanchan

String are read only and immutable. The StringBuffer class
is used to represent characters that can be modified.
StringBuffer is faster than String when performing simple
concatenations.

Is This Answer Correct ?    4 Yes 0 No

Difference String and String Buffer ..

Answer / gangabusi

String is immutable, we can not modify the string objects.
if we can create any string object
Ex: String S="Ganga";
here 'S' is string object created in heap memory.

I Want to add Something to S,
String S="Gangadhar";

Here In heap momory one more object is created for 'S',not
overridden.So that each and every updation String create
one new object in heap.



StringBuffer sb="Ganga"

here 'sb' is stringbuffer object created in heap memory.

I Want to add Something to sb,
StringBuffer sb="Gangadhar";

Here In heap momory 'sb' is overridden.So that each and
every updation StringBuffer create an object in stack.


It is mutable and it is Synchronized.(one thread process at
a time)

Is This Answer Correct ?    2 Yes 0 No

Difference String and String Buffer ..

Answer / a kumar

String buffers are safe for use by multiple threads

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is the difference between synchronized and synchronized block?

0 Answers  


What is collection class in java? List down its methods and interfaces.

0 Answers  


types of applets?.

7 Answers   TCS,


What is the final variable?

1 Answers  


What is gui programming?

0 Answers  


What is anti pattern in java?

0 Answers  


Why main() method is public, static and void in java ?

0 Answers  


Is java util regex pattern thread safe?

0 Answers  


Explain about method local inner classes or local inner classes in java?

0 Answers  


What the difference is between execute, execute Query, execute Update?

0 Answers  


Explain java coding standards for classes or java coding conventions for classes?

0 Answers  


what is class.forname() and how it will be useful ?

3 Answers  


Categories