In Scala mutable collections, sum() method is utilized to find the sum of all the elements of the SortedSet.
Method Definition: def sum: A
Return Type: It returns the sum of all the elements of the SortedSet.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.