The toString() method is utilized to display a string from the Scala SortedMap.
Method Definition: def toString(): String
Return Type: It returns a string from the stated SortedMap.
Map(3 -> geeks, 4 -> for)
Map(2 -> cs, 3 -> geeks, 4 -> for)
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.