Scala 2 dimensional Array and Arrays -


this question has answer here:

i trying write java ode in scala , think need help. problem:

java:

public static int[][] scorematrix = new int[5][20]; 

scala:

var scorematrix: array[array[int]] = new array[array[int]](5, 20) 

it's not working, don't know why?

error "too many arguments constructor array(_length:int)array[array[int]]"

for initializing 5*20 2d int array can use:

var scorematrix: array[array[int]] = array.ofdim[int](5, 20) 

your code doesn't work because array constructor has 1 argument, array length.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -