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 between String and StringBuffer.

Answers were Sorted based on User's Feedback



Difference between String and StringBuffer...

Answer / minu

hi
i am agree with Madhu ,
String is an immutable object. StringBuffer is a mutable
object.
immutable object:If you are not allowed to change the value
of an object, it is immutable object.

mutable object: If a object value is changeable then we can
call it as Mutable object.

Is This Answer Correct ?    14 Yes 0 No

Difference between String and StringBuffer...

Answer / madhu

string is imutable and stringbuffer is mutable

Mutable means storing location is same
Imutable means storning location is different

Is This Answer Correct ?    8 Yes 0 No

Difference between String and StringBuffer...

Answer / geetha

String and StringBuilder class stores strings. But when you
cannot change a String object after creating one.
eg: String name = "Prasad";
By saying you cannot change the name object means you cannot
change the value in name object internally. When you change
the name object value to something else, a new String object
is creating in memory and assign the new value.

eg: name = "Prasad Reddy";

A new name object is creating in memory and the value
"Prasad Reddy" is assinging to the newly created space.

But StringBuilder class occupies the same space even if you
change the value.

If you are doing string concatenation StringBuilder class is
far better in performance than String class.

You can use StringBuilder's Append() method to use
concatenation.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you create a first line indent?

0 Answers  


When do you create an index?

0 Answers  


How to find the length and capacity of a string buffer ?

2 Answers  


How do you override a private method in java?

0 Answers  


What are methods of a class?

0 Answers  


what is anonymous class in java?

0 Answers  


What are the benefits of operations in java?

0 Answers  


how to create constants in java?

0 Answers  


What are the access modifiers available in java?

0 Answers  


Explain what are final variable in java?

0 Answers  


why we use merge option in hybernate pls give a ex snippet

0 Answers   CoreObjects,


What are the changes in java.io in java 8 ?

0 Answers  


Categories