Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started