Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions