The thing is that I'm trying to print the matrix previously created in the constructor, but seems that it's empty.
Here's the code of the constructor:
public Matrix(int row_col){
int [][] randomMatrix = new int[row_col][row_col];
Random rand = new Random();
if (row_col > 0 && row_col < ROW_LIMIT && row_col < COL_LIMIT)
for (int i = 0; i < randomMatrix.length; i++)
for (int j = 0; j < randomMatrix[0].length; j++)
randomMatrix[i][j] = rand.nextInt(51);
}
And the code of the method print:
public void print(){
int row = randomMatrix.length;
int col = randomMatrix[0].length;
for(int i=0 ; i < row ; i++)
for(int j=0 ; j < col ; j++)
System.out.print(randomMatrix[i][j]);
}
Greetings!