Write a method named swapall that accepts two arrays of


Question: 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}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a method named swapall that accepts two arrays of
Reference No:- TGS02381125

Now Priced at $15 (50% Discount)

Recommended (93%)

Rated (4.5/5)