Q. Which method is used to remove all elements from a collection?

A
removeAll()
B
clear()
C
delete()
D
empty()
Solution:

The clear() method removes all elements from a collection, leaving it empty.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!