Which of these method can be used to increase the capacity of ArrayList object manually?

Nam Lê

Member
Which of these method can be used to increase the capacity of ArrayList object manually?
A. Capacity()
B. increaseCapacity()
C. increasecapacity()
D. ensureCapacity()
 
Answer: d
Explanation: 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);
 

Tìm kiếm

Back
Top