I'm trying to get the length of a row of a square 2d array, of which I have set the size using this method:
public static void create (String[][] x, int y) {
x = new String[y][y];
}
The error that shows up is "Null Pointer Exception", and I know that I can fix this issue by just getting rid of the arguement and just using the 2d array variable I want to change in the method, but I just wanted to know if there was a way to get around the error.