[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Discussion :: Java

14.
Difference between StringBuffer and StringBuilder

Answer:

StringBuffer:




  1. StringBuffer is less efficient than StringBuilder.

  2. StringBuffer is synchronized i.e. thread safe. It means two threads can't call the methods of StringBuffer simultaneously.



StringBuilder:




  1. StringBuilder is more efficient than StringBuffer.

  2. StringBuilder is non-synchronized i.e. not thread safe. It means two threads can call the methods of StringBuilder simultaneously.

Asked In :: Aricent

Post Your Answer Here:

Name *
Email
Alert me

Post Your Reply Here:

Report Error

Please Login First Click Here