Collections Framework In Java - Study Mode

[#1] In Java, which method is used to add an element to a collection in the Java Collections Framework?
Correct Answer

(C) `add()`

[#2] What is the purpose of the `toArray()` method in the Java Collections Framework?
Correct Answer

(B) It converts a collection to an array

[#3] In the Java Collections Framework, which class provides methods to manipulate the size of a list and its elements?
Correct Answer

(C) `Collections`

[#4] What is the purpose of the `Iterator` interface in the Java Collections Framework?
Correct Answer

(D) It provides a way to iterate over a collection's elements

[#5] Which method is used to remove all elements from a collection in the Java Collections Framework?
Correct Answer

(A) `clear()`