Question: Write the following generic method using selection sort and a comparator. Write a test program that creates an array of 10 GeometricObjects and invokes this
Write the following generic method using selection sort and a comparator.
![public static void selectionSort(E[] list, Comparator](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/11/636a73be1550a_830636a73be04cbe.jpg)
Write a test program that creates an array of 10 GeometricObjects and invokes this method using the GeometricObjectComparator introduced in Listing 20.4 to sort the elements. Display the sorted elements. Use the following statement to create the array..

Listing

public static void selectionSort(E[] list, Comparator
Step by Step Solution
3.40 Rating (163 Votes )
There are 3 Steps involved in it
Program Plan Create class Exercise21 with selectionSortE array Comparatorcomparator method Create abstract class GeometricObject which implements Comparable It contains methods to calculate parameter ... View full answer
Get step-by-step solutions from verified subject matter experts
