Kotlin HashSet random()
Syntax & Examples
Syntax of HashSet.random()
There are 2 variations for the syntax of HashSet.random() extension function. They are:
1.
fun <T> Collection<T>.random(): TThis extension function returns a random element from this collection.
2.
fun <T> Collection<T>.random(random: Random): TThis extension function returns a random element from this collection using the specified source of randomness.