Sail E0 Webinar
Question
Which of these method can be used to increase the capacity of ArrayList object manually?
Options:
A .  Capacity()
B .  increaseCapacity()
C .  increasecapacity()
D .  ensureCapacity()
Answer: Option D


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(x)



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers