Question: Implement a public non - final class called Ferret. Ferret should provide a single constructor that takes a double, the length of that Ferret instance.
Implement a public nonfinal class called Ferret. Ferret should provide a single constructor that takes a double, the length of that Ferret instance. You should also provide public getters and setters for the length following our usual convention: getLength and setLength. Ferret should not expose any of its internal state publicly.
Ferret should also implement Comparable comparing ferrets based on their length. As a reminder, first.compareToObject second returns a positive int if first is larger than second, a negative int if first is smaller than second, and if they are equal. If second is null or not a Ferret you should also return a negative value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
