I don't understand what the task wants from me.
package pl.codegym.task.task14.task1405;
/*
Jedzonko
*/
public class Solution {
public static void main(String[] args) {
Food food = new Food();
Selectable selectable = new Food();
Food newFood = (Food) selectable;
foodMethods(food);
selectableMethods(selectable);
}
public static void foodMethods(Food food) {
Food foof = new Food();
foof.onSelect();
foof.onEat();
//tutaj wpisz swój kod
}
public static void selectableMethods(Selectable selectable) {
Food f = new Food();
f.onSelect();
f.onEat();
}
interface Selectable {
void onSelect();
}
static class Food implements Selectable {
public void onEat() {
System.out.println("Jedzonko zostało zjedzone");
}
@Override
public void onSelect() { System.out.println("Jedzonko zostało wybrane"); }
}
}