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)- A3% (1)
- B74% (26)
- C14% (5)
- D9% (3)
Community Discussion
No community discussion yet for this question.