I was able to do the task, but some things are not clear and I'd like if someone can help me clarify: When we declare
Selectable selectable = new Food();
What does exactly the created object references to? We cannot instantiate an interface... So, are we actually creating a Food object, but the only methods available are the ones belonging to the interface? Using the instanceof method like below, it return true on both, so why the onEat() method is not available from the selectable object?
selectable instanceof Selectable
selectable instanceof Food
Thanks!