Scala Mutable SortedSet foreach() method
In Scala mutable collections, SortedSet foreach() method is utilized to apply the given function to all the elements of the SortedSet. Method Definition: def foreach(f: (A) => Unit): Unit Return Type: It returns all the elements of the SortedSet after applying the given function to each of them.