interface Allat { public void eszik(String etel); public abstract void beszel(); } class Szamar implements Allat { String gyomor = ""; public void eszik(String etel) {, ott minden metódus virtuális. gyomor += etel; } public void beszel() { System.out.println("ia\'ia\'"); } } class Boci implements Allat { String gyomor = ""; public void eszik(String etel) { gyomor += etel; } public void beszel() { System.out.println("buuuuuuuuuu"); } } class Program01 { public static void main(String[] args) { Szamar pici = new Szamar(); pici.beszel(); Boci mici = new Boci(); mici.beszel(); } }