Collections
- Which of these method is used to reduce the capacity of an ArrayList object?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
trimTosize() is used to reduce the size of the array that underlines an ArrayList object.
- Which of these methods can be used to obtain a static array from an ArrayList object?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
toArray()
- Which of these method of ArrayList class is used to obtain present size of an object?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
size()
- Which of these method can be used to increase the capacity of ArrayList object manually?
-
View Hint View Answer Discuss in Forum
NA
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);
- Which of these class can generate an array which can increase and decrease in size automatically?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
ArrayList()