A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
The big question is: What makes one Shape less than, equal to, or greater than another Shape?
You can't implement the Comparable interface until you make that decision.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
First, I think you should create the ShapeComparator class in it's own file so you don't have to worry about the messiness of inner classes yet.
Second, the ShapeComparator assumes that Shape has a compareTo() method which means it probably implements the Comparable interface. If Shape impelements Comparable, there is no reason to have a separate ShapeComparator class.
We don't have time for this. We've gotta save the moon! Or check this out:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|