public class Human { public interface MyAction { public void getPower(); } }
public class Test{ public static void main(String[] args) { new Human.MyAction() { @Override public void getPower() { } }
或 new Human.MyAction(){ @Override public void getPower() { } } } }
原文:https://www.cnblogs.com/znsongshu/p/9383948.html