Multiple choice technology programming languages

Among the following what is the advantage of StringBuilder over StringBuffer?

  1. Faster performance

  2. Methods are synchronised

  3. Thread-safety

  4. Multithreading

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

StringBuilder is not thread-safe - its methods are NOT synchronized, which eliminates synchronization overhead. StringBuffer is thread-safe with synchronized methods, making it slower. The main advantage of StringBuilder is faster performance in single-threaded environments.