Scala Set take() method with example
The take() method is utilized to return a set consisting of first ‘n’ elements of the set.
Method Definition: def take(n: Int): Set[A]
Where ‘n’ is specifies the number of element to select.
Return Type: It returns a set consisting of first ‘n’ elements of the set.
Set(41, 12, 23)