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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started