Java OCA OCP Practice Question 577

Question

Which of the following statements are true?

  • A. StringBuilder is generally faster than StringBuffer.
  • B. StringBuffer is generally faster than StringBuilder.
  • C. StringBuilder is threadsafe; StringBuffer is not.
  • D. StringBuffer is threadsafe; StringBuilder is not.


A, D.

Note

StringBuffer is threadsafe, StringBuilder is fast.




PreviousNext

Related