When you're setting up the constructor, the constructor expects not only how many rows and columns you have, but also an already made two-dimensional array, or a table for example. Since we want to construct a grid in the constructor, it's best to get rid the pattern[][] from the constructor, leaving rows and columns untouched.
There's also no need to have an emptyGrid instance since you'll be creating a table everytime you call the constructor.
To iterate through an array in this case, you can use a for loop, which will start with an integer variable, i, equal to 0, because arrays counts its elements starting from 0. Since you have a set number of rows and columns, you can use those to make an expression whether the variable, i, is less than the number of columns or rows, and then after the execution of the for loop is finished, you can simply increment variable i by one.
The for loop looks something like this:
for (int i = 0; i < 5; i++){
//code
}
For this code, we'll be using two for loops since the array has two dimensions.
For setting a number inside of an array, you can use the first and the second variable of an array to set a number in a specific place inside of an array.
array[i][j] = //any number you want
Then afterward create a method that will get the grid instance so that all classes can access it.
Finally, to obtain all the elements inside of arrays that have more than one dimension, you can call this to get all of elements.
Arrays.deepToString(array);