Multiple choice technology programming languages

By using which method ,How can one increase size of an ArrayList?

  1. incSize(int minCapacity)

  2. ensureCapacity(int minCapacity)

  3. incCapicity(int minCapacity)

  4. All of the Above

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

ArrayList uses ensureCapacity(int minCapacity) to request internal capacity expansion before adding elements. This is an optimization to avoid multiple internal array resizes. Option A's 'incSize' and option C's 'incCapicity' (misspelled) don't exist in the API.