Question: I need codes for the print method!(JAVA plz) 13) Given the following class: class Planet implements comparablexplanet> f private String name; private float massKgs; public
I need codes for the print method!(JAVA plz)

13) Given the following class: class Planet implements comparablexplanet> f private String name; private float massKgs; public String getName ) f return name;y // Also hashcode(), compareTo(), and equals) Assume planet's hashCode, compareTo, and equals methods all work correctly. Write the following method. Assume the method is not inside the Planet class. void print(Planetl] planets, Stringl] finder) ) First use an assertion to make sure the 2 inp contains the name of the scientist who discovered planets[xJ. Your m ut arrays are the same length. For any x, finder[x] ethod should print 1 lin h planet in the input. The line should give the name of the planet, followed by the name of that planet's discoverer The planets should appear in the order imposed by compareTo. (15 points... zer comments.) o points for any solution longer than 10 lines, not counting curlies and
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
