MCQs
Total Questions : 45
| Page 2 of 5 pages
Answer: Option A. -> ArrayList()
ArrayList()
Answer: Option A. -> size()
size()
Answer: Option D. -> ensureCapacity()
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)
Answer: Option A. -> Array()
Array()
Answer: Option C. -> ArrayList
ArrayList class implements a dynamic array by extending AbstractList class.
Answer: Option D. -> trimToSize()
trimTosize() is used to reduce the size of the array that underlines an ArrayList object.
Answer: Option D. -> addFirst()
addFirst()
Answer: Option B. -> LinkedList
LinkedList
Answer: Option A. -> add()
add()
Answer: Option B. -> HashSet
HashSet and TreeSet implements Set interface where as LinkedList and ArrayList implements List interface.