Which of the following methods can be used to manually increase the capacity of an ArrayList object?
A. Capacity ()
B. Increase Capacity ()
C. enhance capacity ()
D. ensureCapacity ()
Answer:D
Which of the following methods can be used to manually increase the capacity of an ArrayList object?
A. Capacity () B. Increase Capacity () C. enhance capacity () D. ensureCapacity ()
Explanation: When we add an element, the capacity of the ArrayList object increases automatically, but we may raise it manually to a predetermined length x by using the function ensureCapacity (x)