The toList() method is utilized to return a list consisting of all the elements of the set.
Method Definition: def toList: List[A]
Return Type: It returns a list consisting of all the elements of the set.
5 1 2 3 4
1 41 12 72 43 23
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.