Comparing Apples to Apples
Several incomplete classes are provided in the starter project that each implement the Comparable interface. Write the body of the compareTo
method for each of these classes such that it behaves as follows:
- An
AppleBasketshould be sorted by the number of apples it contains. - A
Personshould be sorted alphabetically by last name and then first name ascending. - A
BirthdayRemindershould be sorted chronologically by date. - A
3DPointshoud be sorted by distance from the origin.