I want to remove an element after creating the below 2d array.And it should be the last element of the array.
public static void main(String[] args) {
        int i;
        int row = 2;
        int col = 2;
        String[][] queue = new String[row][col];
        Scanner scanner = new Scanner(System.in);
        String[][] queue = new String[row][col];
        Scanner scanner = new Scanner(System.in);
        for (row = 0; row < queue.length; row++) { // Loop through the rows in the 2D array.
            for (col = 0; col < queue[row].length; col++) { 
                System.out.println("Enter the name");{
                    queue[row][col] = scanner.next();
                }
                }
            }
        for (i = 0; i < row; i++) {
            for (int j = 0; j < col; j++) {
                System.out.print(queue[i][j] + " ");
 
     
    