I am trying to return a 2D array from a method but I am returning some weird code back instead; I was expecting that to return a 3x3 array filled in
|x,x,x|
|x,x,x|
|x,x,x|
but I am getting back this code [[I@3cd1a2f
any help?
import java.util.*;
class Untitled {
public static void main(String[] args) {
System.out.print(test());
}
public static int[][] test(){
int[][] result = new int[3][3];
for(int i=0; i< 3 ; i++) // i = x
{
for(int j=0; j<3; j++) // j = y result = [i][j]
{
result[i][j] = i;
}
}
return result;
}
}