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 & StringBuffer

Answer Posted / niranjanravi

String objects are constants and immutable where as
StringBuffer objects are not.StringBuffer Class supports
growable and modifiable string where as String class
supports constant strings. Strings once created we cant
modify them. Any such attempt will lead to the creation of
new strings.Where as StingBuffer objects after creation
also can be able to delete oo append any characteres to
it.String values are resolved at run time where as
StringBuffer valuesc are resolved at compile time.So if you
know the exact size of the string to be appended it is
better to go for String objects.

Is This Answer Correct ?    194 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the common uses of "this" keyword in java ?

1021


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

1323


What are thread groups?

1002


Explain enumeration in java?

1006


Why singleton class is used in java?

1134


What do you understand by garbage collection in Java? Can it be forced to run?

985


Define max and min heap, also the search time of heap.

1027


who can i handle multiple client in RMI

1897


How do I stop concurrentmodificationexception?

1032


What is the difference between yield() and sleep()?

1015


how to open and edit XML file in Weblogic???

1971


What does system.gc() and runtime.gc() methods do?

1053


What java is used for?

1073


What is the size of boolean variable?

1077


What is the need of transient variables in Java ?

1072