Question: PLEASE DO NOT MOVE anything and PLEASE HIGHLIGHT THE ANSWER, THANK YOU IN JAVA please and please only fix what it on BOLD, THANK YOU

PLEASE DO NOT MOVE anything and PLEASE HIGHLIGHT THE ANSWER, THANK YOU

IN JAVA please and please only fix what it on BOLD, THANK YOU (Generics.java)

public class Generics{ public static void main(String[] args) { Integer[] intArray = {5, 3, 100, 27, 81, 4, 35}; Double[] doubleArray = {1.28, 5.3, 7.9, 0.5, 0.3, 2.8}; Character[] charArray = {'H', 'E', 'L', 'L', 'O'}; System.out.println(maxElement(intArray)); System.out.println(maxElement(doubleArray)); System.out.println(maxElement(charArray)); System.out.println(); System.out.println(minElement(intArray)); System.out.println(minElement(doubleArray)); System.out.println(minElement(charArray)); System.out.println(); printArray(intArray); System.out.println(); printArray(doubleArray); System.out.println(); printArray(charArray); System.out.println(); } /*FIXME(1) Implement static method maxElement() which takes a T[] array as argument, and returns the maximum element in the array. Note that T extends Comparable*/ /*FIXME(2) Implement static method minElement() which takes a T[] array as argument, and returns the minimum element in the array. Note that T extends Comparable*/ public static > void printArray(T[] array){ for(int i = 0; i < array.length; i++) { System.out.println(array[i]); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!