Multiple choice technology programming languages

Which class creates a mutable string that can be used by multiple threads?

  1. String

  2. StringBuffer

  3. StringBuilder

  4. none

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

StringBuffer is a mutable string class with synchronized methods, making it thread-safe. StringBuilder is also mutable but not thread-safe. String itself is immutable.