Question: using Java CHALLENGE ACTIVITY 5.9 2. Modify an array parameter. Write a method swapArrayEnds) that swaps the first and last elements of its array parameter.
CHALLENGE ACTIVITY 5.9 2. Modify an array parameter. Write a method swapArrayEnds) that swaps the first and last elements of its array parameter. Ex sortArray = {10,20,30,40) becomes (40, 20, 30, 10) 1 import java.util.Scanner; 2 3 public class ModifyArray ( 4 5 6 y Your solution goes here 3 1e 11 12 13 public static void main(String[] args) { Scanner ser-new Scanner(System.in); int nuntlem - 43 int[] sortArray = new int[nunt len): Int 1: int user un for (1-8; 1 sortArray.length; ++i) { sortArray[i] = sehr.nextInt(); > 15 16 17 18 19 20 swapArrayEnds(sortArray); for (1 - ; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
