- the object which implements
Comparable
isFegan
.
The method compareTo
you are overidding in it should have a Fegan
object as a parameter whereas you are casting it to a FoodItems
. Your compareTo
implementation should describe how a Fegan
compare to another Fegan
.
- To actually do your sorting, you might want to make your
FoodItems
implementComparable
aswell and copy paste your actualcompareTo
logic in it.