Home » JAVA Programming » Collections » Question
  1. Which of these method can be used to increase the capacity of ArrayList object manually?
    1. increasecapacity()
    2. ensureCapacity()
    3. Capacity()
    4. increaseCapacity()
    5. None of these
Correct Option: B

When we add an element, the capacity of ArrayList object increases automatically, but we can increase it manually to specified length x by using function ensureCapacity(p);



Your comments will be displayed only after manual approval.