public class food {
void eat() {
System.out.println("this food is great");
}
}
public class tuna extends food{
void eat(){
System.out.println("this tuna is great");
}
}
public class potpie extends food{
void eat(){
System.out.println("this potpie is great");
}
}
the result is :
this potpie is great
this tuna is great