Question: In Java: Create a NetBeans project called F1. Add a Dog class to it (you can copy the Dog class from dogExample ) Alter the

In Java:

Create a NetBeans project called F1.

Add a Dog class to it (you can copy the Dog class from dogExample )

Alter the class so that there is another attribute called weight. (This means you need to alter the constructors, the toString method, and also add methods getWeight() and setWeight() ).

Alter the class to make it implement Comparable

Write a compareTo method. Compare two Dog objects according to their weight

THEN, in the file called F1.java, create two dogs and output the largest and the smallest.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!