Kotlin HashSet retainAll()
Syntax & Examples


Syntax of HashSet.retainAll()

The syntax of HashSet.retainAll() function is:

fun retainAll(elements: Collection<E>): Boolean

This retainAll() function of HashSet retains only the elements in this collection that are contained in the specified collection.