0
/ 40
Modify the Cage
class to implement Comparable
. The definition of the Comparable
interface can be found here. Remember that Comparable has...
Modify the Cage
class to implement Comparable
. The definition of the
Comparable
interface can be found here.
Remember that Comparable has one abstract
method, int compareTo(T o)
. Two Cages
can be compared based on their size
obtained via getSize()
.
You must (1) implement the interface, and (2) define the compareTo
method.
Your feedback will appear here when you check your answer.