Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats the difference between a StringBuffer and StringBuilder?

difference StringBuffer
0
Posted

Whats the difference between a StringBuffer and StringBuilder?

0

Author: Bikash Praharaj (http://www.jguru.com/guru/viewbio.jsp?EID=1345362), Aug 20, 2007 In simple words StringBuffer is synchronized whereas StringBuilder is not synchronized…

0

Location: http://www.jguru.com/faq/view.jsp?EID=1251263 Created: Jun 30, 2005 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) The StringBuilder class was introduced with JDK 5.0. Essentially, a StringBuffer is a thread-safe version of StringBuilder. If you are only adding/removing characters from a single-thread, the StringBuilder implementation will be faster. If you are using multiple threads to add and remove characters, use StringBuffer.

0

Author: java learner (http://www.jguru.com/guru/viewbio.jsp?EID=1645510), Sep 2, 2011 Main difference between String and StringBuffer in java is String is immutable while StringBuffer is mutable means you can modify a StringBuffer object once you created it without creating any new object. This mutable property makes StringBuffer an ideal choice for dealing with Strings in Java. You can convert a StringBuffer into String by its toString() method. String vs StringBuffer or what is difference between StringBuffer and String is one of the popular interview questions for either phone interview or first round. Now days they also include StringBuilder and ask String vs StringBuffer vs StringBuilder.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123