So I have a method that looks like this:
public Maze(String[] textmaze, int startRow, int startCol, int finishRow, int finishCol){
int numRows = textmaze.length;
int numCols = textmaze[0].length;
int [][] x = new int[numRows][numCols];
}
So I want to use the variables x, numRows and numCols in other methods however numRows and numCols needs the String textmaze which must be passed in as a parameter and the main method where this method is called is in another class which I'm not allowed to modify. So how can I use those variables in other methods?