In Scala mutable collections, last() method is utilized to return the last element of the SortedSet.
Method Definition: def last: A
Return Type: It returns the last element 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.