Answers for "initialize list scala"

C
1

Make a list in scala

val list = List(1,2,3)
// or you can specify the type:
val list: List[Int] = List(1,2,3)
// or use the :: syntax (with or without the type specified)
val list = 1 :: 2 :: 3 :: Nil
Posted by: Guest on August-24-2021

Code answers related to "C"

Browse Popular Code Answers by Language