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?

Answers were Sorted based on User's Feedback



what is stringBuffer and StringBuilder?..

Answer / 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

what is stringBuffer and StringBuilder?..

Answer / modi[achir communication]

All methods in StringBuffer class are Synchronized whereas
in StringBuilder class methods are not synchronized.
StringBuilder is faster than StringBuffer because of the
synchronized method in StringBuffer.

Is This Answer Correct ?    4 Yes 1 No

what is stringBuffer and StringBuilder?..

Answer / srinu

StringBuffer:-
1)All methods in String Buffer class are Synchronized.
2)Performance is slow because these are synchronized.

StringBuilder:-
1)StringBuilder class methods are not synchronized.
2)performance is faster.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

How can I scroll through list of pages like the search results in google?

0 Answers  


Have you used threads in Servelet?

0 Answers   Satyam,


Difference between swing and awt?

0 Answers  


whats is mean by connectionpooling

2 Answers   SolutionNET,


Suppose there are 3 combo box. SELECT COUNTRY SELECT STATE SELECT CITY if i select any country from country conutrylistbox values in the state will get automatically inserted with database values>> THEN on selection of state city will be inserted in city combo box If you can help then please Help me...

2 Answers   HCL,


How many JSP scripting elements and what are they?

4 Answers   TCS,


difference between sql exception class and sql warning class

1 Answers  


whats is mean by class.forName() whats the return type of class

6 Answers   SolutionNET,


What is an abstract method?

0 Answers  


what is heepStored?

1 Answers  


What is RMI Registry?

6 Answers   Siemens, United Software Solutions,


What’s jboss jbpm?

0 Answers  


Categories