Question: write the code in java language Use Comparator Write the following generic method using selection sort and a comparator: Write a test program that creates
Use Comparator 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 method using the Geometricobjectcomparator introduced in Listing 20.5 to sort the elements. Display the sorted elements. Use the following statement to create the array: Geometricobject [ ] list1 = \{new Circle(5), new Rectangle(4,5), new Circle(5.5), new Rectangle (2.4,5), new Circle(0.5), new Rectangle (4,65), new Circle (4.5), new Rectangle (4.4,1), new Circle (6.5), new Rectangle (4,5)}; Also in the same program, write the code that sorts six strings by their last character. Use the following statement to create the array: String[] list2 = \{"red", "blue", "green", "yellow", "orange", "pink" }; Please submit the following: 1. The compressed (zip) file containing your entire project 2. The captured screen image or images (ipeg or png) demonstrating all of your program's output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
