- the object which implements
ComparableisFegan.
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
FoodItemsimplementComparableaswell and copy paste your actualcompareTologic in it.