Question: You must create a Java class named TenArrayMethods in a file named TenArrayMethods.java . This class must include all the following described methods. Each of
You must create a Java class named TenArrayMethods in a file named TenArrayMethods.java. This class must include all the following described methods. Each of these methods should be public and static.Write a method named getFirst, that takes an Array of int as an argument and returns the value of the first element of the array. NO array lists.
Write a method named getLast, that takes an Array of int as an argument and returns the value of the last element of the array.
Write a method named getAllButFirst, that takes an Array of int as an argument and returns a new array with all of the values in the argument array except the first value.
Write a method named getIndexOfMin, that takes an Array of int as an argument and returns the index of the least value in the array.
Write a method named getIndexOfMax, that takes an Array of int as an argument and returns the index of the largest value in the array.
Write a method named swapByIndex, that takes three arguments. The first argument is an Array of int, and the second and third arguments are int indexes. This method will swap the values at the two given index arguments in the array, and return the array.
Write a method named removeAtIndex, that takes two arguments. The first argument is an Array of int, and the second argument is an int index. This method create a new array with all of the values in the argument array except the value at the argument index.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
