Multiple choice

After having constructed a StringBuffer, which of the following methods is used to ensure that the buffer capacity is not less than the specified minimum?

  1. setLength()

  2. length()

  3. capacity()

  4. startWith()

  5. Ensure capacity()

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

This method is used to ensure that the buffer capacity is not less than the specified minimum.