What is the function of the retainAll() method from the Collection interface?

What is the function of the retainAll() method from the Collection interface?



Answer: Attempts to retain only elements that are included in the provided collection. Returns true if at least one of the elements is retained.


Learn More :

Data Structures

Learn More Multiple Choice Question :