亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

代碼
提交代碼
@FunctionalInterface interface TestFunctionalInterface { //抽象方法 public void doTest(); //java.lang.Object中的public方法 public boolean equals(Object obj); public String toString(); //默認方法 public default void doDefaultMethod(){System.out.println("call dodefaultMethod");} //靜態方法 public static void doStaticMethod(){System.out.println("call doStaticMethod");} public static void main(String...s){ //實現抽象方法 TestFunctionalInterface test = ()->{ System.out.println("call doTest"); }; //調用抽象方法 test.doTest(); //調用默認方法 test.doDefaultMethod(); //調用靜態方法 TestFunctionalInterface.doStaticMethod(); //調用toString方法 System.out.println(test.toString()); } }
運行結果