aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Strings
  • Which method is used to set the size of the buffer?
Multiple choice

Which method is used to set the size of the buffer?

  1. charAt()

  2. setLength()

  3. ensureCapacity()

  4. valueOf()

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

The 'ensureCapacity()' method is used to set the size of the buffer.

Keep practicing — related questions

  • Which of the foolowing methods in StringBuffer class is used to set the length of the buffer within a Strin...
  • After having constructed a StringBuffer, which of the following methods is used to ensure that the buffer c...
  • Which of the following methods is used to pre-allocate a space for a certain number of characters, after a ...
  • Which of the following methods is used to pre-allocate a space for a certain number of characters, after a ...
  • Which of the following methods is used to pre-allocate a space for a certain number of characters, after a ...
  • Which of the following methods is used to preallocate room for a certain number of characters after a Strin...
  • Which of the following functions pre-allocate room for a certain number of characters after a StringBuffer ...
  • Which of the following methods of StringBuffer class is used to pre-allocate room for a certain number of c...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Java Core Classes and Threads (1473 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy