How to define a list of lists in Scala?

前端 未结 5 1282
慢半拍i
慢半拍i 2021-01-11 23:37

I would like to create a storage for the following type:

List(List(2.3,1.1),List(2.2, 1))

But if I do the following:

var y         


        
5条回答
  •  北海茫月
    2021-01-12 00:25

    var y:List[List[Double]] = List(List (1.0, 2.2), List(2, 1.1, -2.1))
    
    y(0)(0)*2
    

提交回复
热议问题