Question : Make a list in scala
Answered by : dan-gordon
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
Source : | Last Update : Tue, 31 Aug 21