VOOZH about

URL: https://www.geeksforgeeks.org/scala/scala-set-tolist-method-with-example/

⇱ Scala Set toList() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set toList() method with example

Last Updated : 18 Oct, 2019
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.
Example #1:
Output:
5
1
2
3
4
Example #2:
Output:
1
41
12
72
43
23
Comment

Explore