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...

what is stringBuffer and StringBuilder?

Answer Posted / anonymous

String is immutable whereas StringBuffer and StringBuilder
can change their values.

The only difference between StringBuffer and StringBuilder
is that StringBuilder is unsynchronized whereas
StringBuffer is synchronized. So when the application needs
to be run only in a single thread then it is better to use
StringBuilder. StringBuilder is more efficient than
StringBuffer.

Criteria to choose among String, StringBuffer and
StringBuilder

If your text is not going to change use a string Class
because a String object is immutable.
If your text can change and will only be accessed from a
single thread, use a StringBuilder because StringBuilder is
unsynchronized.
If your text can changes, and will be accessed from
multiple threads, use a StringBuffer because StringBuffer
is synchronous.

Is This Answer Correct ?    26 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why a client should be multithreading? Explain.

1035


Why does the tag url-encode javascript and mailto links?

957


Is the ternary operator written x : y ? Z or x ? Y : z ?

1049


What is the difference between ear, jar and war file?

1066


What is ioc concept & explain it?

1038


Can I use javascript to submit a form?

1098


whats is statement and procedure

2134


What is table mutation and how do you avoid it?

2417


what is a portable component?

1933


Should synchronization primitives be used on bean methods?

1004


What is the diffrence between a local-tx-datasource and a xa-datasource?

996


Explain ioc concept?

1073


What do you need to set-up a cluster with jboss?

1020


What is the highest-level event class of the event-delegation model?

1034


Describe responsibilities of Activator?

2171