swapAll
Write a method named swapAll
that accepts two arrays of
integers as parameters and swaps their entire contents. You may assume that
the arrays passed are not null and are the same length.
For example, if the following arrays are passed:
int[] a1 = {11, 42, -5, 27, 0, 89}; int[] a2 = {10, 20, 30, 40, 50, 60}; swapAll(a1, a2);
After the call, the arrays should store the following elements:
a1: {10, 20, 30, 40, 50, 60} a2: {11, 42, -5, 27, 0, 89}