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 difference between String buffer and String builder?

Answers were Sorted based on User's Feedback



what is difference between String buffer and String builder?..

Answer / chithra

String Buffer is Sybchronized where as String Builder is not.

Is This Answer Correct ?    20 Yes 1 No

what is difference between String buffer and String builder?..

Answer / subhareddy

There is no much difference between string buffer and string
builder.only thing is all the methods available in string
buffer class are synchronized methods.and the method
available in string builder class are non-synchronized methods.
If we want thread safety then we have to go for string
buffer ,but performance goes down.if we don't want thread
safety the we can go for string builder

Is This Answer Correct ?    14 Yes 1 No

what is difference between String buffer and String builder?..

Answer / mohan

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 ?    4 Yes 0 No

what is difference between String buffer and String builder?..

Answer / rajujohn

hi All
Both are mutable ,that means we can change value of the
instance variable using append,insert and ...
But only one difference when you go for the multi-thread
concept you use StringBuffer,Because it is thread safe ,that
means, if one thread access this stringbuffer variable on
the time another thread cant access this stringbuffer,so
stringbuffer is slowest performance compare to stringbuilder.

by raju.j

Is This Answer Correct ?    2 Yes 1 No

what is difference between String buffer and String builder?..

Answer / radhakrishnan

Please visit
http://yourjavatutor.blogspot.in/2011/12/difference-between-stringstringbuffer.html
for more details

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Which is the best approach for creating thread ?

0 Answers  


What is OOPS Concept?

1 Answers   Cap Gemini,


What is meant by attribute?

0 Answers  


ublic class Java_Coding_Samples { public static void JavaHungr(NumberFormatException ae){ System.out.println("integer"); } public static void JavaHungry(Exception e){ System.out.println("string"); } public static void JavaHungry(ArithmeticException ae){ System.out.println("object"); } public static void main(String[] args) { JavaHungry(null); }

1 Answers  


I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?

2 Answers   Honeywell,


What modifiers are used with an inner class which is a member of an outerclass?

1 Answers  


What is default specifier ??? Use of default specifier ???

4 Answers   Cognizant, Syntel,


What is independent and dependent variables in research?

0 Answers  


Which sorting is used in arrays sort in java?

0 Answers  


what do you mean by classloader in java?

0 Answers  


Explain JPA in Java.

1 Answers  


Is 0 true or false?

0 Answers  


Categories