Q. Which method is used to remove all elements from a collection?
Solution:
The clear() method removes all elements from a collection, leaving it empty.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.
The clear() method removes all elements from a collection, leaving it empty.
Strengthen Your Practice with our comprehensive question bank.