Question: java Write a generic method that takes an array of objects (of a valid concrete object type) and prints out the maximum and minimum elements
java
Write a generic method that takes an array of objects (of a valid concrete object type) and prints out the maximum and minimum elements in the array (use toString() method). Notice that you need to compare objects, therefore we need to use interface Comparable. The method signature is as follows: public static > void MinMax(E[] list) Test the method with at least 2 arrays of different concrete object types. Label your outputs properly and show the array lists content before and after calling method MinMax.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
