I am trying to assign numbers randomly. I understand that Math.random() only goes between 0 and 1, and tried to multiply it by 10, and it still does not show any random numbers:
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
the code:
public static void main(String[] args) {
int[][] mdArray = new int[5][5];
for(int i = 0; i<mdArray.length; i++){
for(int j = 0; j<mdArray[i].length; j++) {
mdArray[i][j] = (int)Math.random()*10;
System.out.print(mdArray[i][j] + " ");
}
System.out.println("");
}
}