Hi,
Here is an example you can follow:
scala> var a=ofDim[Int](3,3)
a: Array[Array[Int]] = Array(Array(0, 0, 0), Array(0, 0, 0), Array(0, 0, 0))
Now, let’s fill in some values.
scala> for(i<-0 to 2){
| for(j<-0 to 2){
| a(i)(j)={i+j}
| }
| }
scala> a
res10: Array[Array[Int]] = Array(Array(0, 1, 2), Array(1, 2, 3), Array(2, 3, 4