Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 andStep 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