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
AppleBasket
should be sorted by the number of apples it contains. - A
Person
should be sorted alphabetically by last name and then first name ascending. - A
BirthdayReminder
should be sorted chronologically by date. - A
3DPoint
shoud be sorted by distance from the origin.