Make A List In Scala

[Solved] Make A List In Scala | Scala - Code Explorer | yomemimo.com
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

Answers related to make a list in scala

Code Explorer Popular Question For Scala