VOOZH about

URL: https://www.geeksforgeeks.org/scala/scala-mutable-sortedset-method/

⇱ Scala mutable SortedSet &() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala mutable SortedSet &() method

Last Updated : 26 Mar, 2020
In Scala mutable collection, &() method is utilized to create a new SortedSet consisting of all elements that are present in both the given SortedSets.
Method Definition: def &(that: SortedSet[A]): SortedSet[A] Return Type: It returns a new SortedSet consisting of all elements that are present in both the given SortedSets.
Example #1:
Output:
TreeSet(12, 100)
Example #2:
Output:
TreeSet()
Comment

Explore