Swapping two arrays

As it is shown in the video, we are not able to swap the references to arrays. So, how will we swap the references to two variable sized array?

As the two-dimensional array in java is actually a array of references to other arrays, you can simply swap the references as shown below:

public static void swapRows(int array[][], int rowA, int rowB) {
   int tmpRow[] = array[rowA];
   array[rowA] = array[rowB];
   array[rowB] = tmpRow;
}