[solved]-Write Generic Method Called Swapminmax Complete Exercise One Parameter Array Generic Type Q39065122

java
Write a generic method called SwapMinMax to complete this exercise. It should have one parameter, an array of a generic type. It should take in the array and swap the smallest and largest elements in the array, based on the natural ordering of the type. You may assume any necessary imports are already included. So, for example, if this is the main method: public static void main(String 1 args) { Integer () intArray = {9, 234, 38, 14, 12, 1, 20}; String[strArray = {“strings”, “are” “not” “sorted”, “here”}: Swap Min Max(intArray); for (Integer i: intArray) { System.out.print(i + ” “); System.out.println(); Swap Min Max(strArray); for (String s: strArray) { System.out.print(s + ” “) System.out.println(); Then the output would be: 9 1 38 14 12 234 20 are strings not sorted here Write the method called SwapMinMax. Show transcribed image text Write a generic method called SwapMinMax to complete this exercise. It should have one parameter, an array of a generic type. It should take in the array and swap the smallest and largest elements in the array, based on the natural ordering of the type. You may assume any necessary imports are already included. So, for example, if this is the main method: public static void main(String 1 args) { Integer () intArray = {9, 234, 38, 14, 12, 1, 20}; String[strArray = {“strings”, “are” “not” “sorted”, “here”}: Swap Min Max(intArray); for (Integer i: intArray) { System.out.print(i + ” “); System.out.println(); Swap Min Max(strArray); for (String s: strArray) { System.out.print(s + ” “) System.out.println(); Then the output would be: 9 1 38 14 12 234 20 are strings not sorted here Write the method called SwapMinMax.
Expert Answer
Answer to Write a generic method called SwapMinMax to complete this exercise. It should have one parameter, an array of a generic … . . .
OR

