I'm trying to print a 2D array (size specified by user) with 1s and 0s. However, every time I try to run I get random numbers and letters like "[[I@4eec7777" instead of the 2D array. I commented out the for loops and think I have narrowed down the problem to the initialization of the array? I am not sure what I'm doing wrong.
System.out.print("How many rows? : ");
int numRows = userInput.nextInt(); //numRows works
System.out.print("How many columns? : ");
int numCols = userInput.nextInt(); //numCols works
int randomArray[][] = new int[numRows][numCols];
// for (int row = 0; row < randomArray.length; row++) {
// int temp = (int) ((Math.random()*2)+1);
// for (int col = 0; col < randomArray[row].length; col++) {
// if (temp % 2 == 0) randomArray[row][col] = 1;
// }
// }
System.out.println(randomArray);