Scala TreeSet +() method with example
In Scala TreeSet class, the +() method is utilized to add an element to the TreeSet unless it is already present. Method Definition: def +(elem: A): TreeSet[A] Return Type: It returns a new TreeSet with an additional element unless the element is already present. Example #1: Scala // Scala program o