public interface PetInterface {public abstract void pet();}比如说你的Fruit类实现PetInterface接口写法为:class Fruit implemented PetInterface{public void pet(){}public void hitChild(){System.out.println("水果:");}