VOOZH about

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

⇱ Scala Set toArray() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set toArray() method with example

Last Updated : 18 Oct, 2019
The toArray() is utilized to return an array consisting of all the elements of the set.
Method Definition: def toArray: Array[A] Return Type: It returns an array consisting of all the elements of the set.
Example #1:
Output:
1
2
7
3
4
Example #2:
Output:
1
41
12
72
43
23
Comment

Explore