I created a two-dimensional array that I want to fill with random digits within a range up to 10. However, the printed end-result ends up being all zeros. I cannot see what is wrong with my code, and I am certain everything is correct. I searched for similar issues here at Stack Overflow, but cannot find a problem that is similar to mine. My code is below:
int [][] array = new int [3][3];
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++)
{ array[i][j] = ( (int) Math.random() * 10 );
System.out.print(array[i][j] + " "); }
System.out.println(" "); }