How to create a set of integers in Scala

1 Answer

0 votes
object MyClass {
    def main(args: Array[String]): Unit = {
        var st : Set[Int] = Set(1, 1, 4, 5, 1, 2, 8, 9, 9, 9, 0)
         
        print(st);
    }
}
 
 
 
/*
run:
 
HashSet(0, 5, 1, 9, 2, 8, 4)
 
*/

 



answered Jun 2, 2021 by avibootz
...