package HM; interface inter{ public abstract void sleep(); } public class HelloWorld { public static void main(String[] args){ ff(new inter(){//使用匿名内部类创建接口的对象 public void sleep(){ System.out.println("睡觉"); } public void eat(){ System.out.println("吃饭"); } }); } public static void ff(inter in){ in.sleep(); } }
请问,如果我想调用匿名内部类中.eat方法,该如何调用?
public abstract void eat();