Well technically the size is returned with the array (via the length property). But regardless, you cannot recreate the reference to the array in the method and hope that change takes effect outside...
Type: Posts; User: copeg
Well technically the size is returned with the array (via the length property). But regardless, you cannot recreate the reference to the array in the method and hope that change takes effect outside...
Didn't spot this earlier (obviously), but you re-assign the variable mat in the load method, once the load method exits that variable is out of scope (and the parameter unchanged - pass by value )....
You've passed the array as a parameter, so just loop through the array by row/colum
for ( int i = 0; i < mat.length; i++ ){
for ( int j = 0; j < mat[i].length; j++ ){
//do something...