We can use the .clear method on a List,Map or Set in java to delete all elements from the corresponding collections.
Please note .clear does not delete the List,Map or Set itself. It just deletes all the elements present inside them
list.clear()
myMap.clear()
mySet.clear()