nerdexam
GIAC

GSSP-JAVA · Question #71

Which of the following methods is used to preallocate room for a certain number of characters after a StringBuffer has been constructed?

The correct answer is B. ensureCapacity(). See the full explanation below for the reasoning.

Question

Which of the following methods is used to preallocate room for a certain number of characters after a StringBuffer has been constructed?

Options

  • Acapacity()
  • BensureCapacity()
  • CsetCapacity()
  • DallocateCapacity()

How the community answered

(35 responses)
  • A
    3% (1)
  • B
    74% (26)
  • C
    14% (5)
  • D
    9% (3)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice