Test Preparation on JAVA Test Prep. The Collections Framework
1.
Which of these standard collection classes implements a dynamic array?
Explanation: ArrayList class implements a dynamic array by extending AbstractList class.
2.
Which of these class can generate an array which can increase and decrease in size automatically?
3.
Which of these method can be used to increase the capacity of ArrayList object manually?
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);
4.
Which of these method of ArrayList class is used to obtain present size of an object?
5.
Which of these methods can be used to obtain a static array from an ArrayList object?