So I'm trying to add a column at the end of a 2d array. What I've tried to do is to make a copy of the array but with the length being 1 bigger. The only problem is that that expands the rows, not the columns.
// Trying to make the 2d array bigger
public static String[][] FLname = new String[1][0];
FLname = Arrays.copyOf(FLname, FLname.length + 1);
// Inserting the values
FLname[0][FLname.length - 1] = fName;
FLname[1][FLname.length - 1] = lName;
I end up getting a ArrayIndexOutOfBoundsException
Any help would be appreciated!