函数式接口难道只能写一个抽象方法吗?如果要有多个,是不是需要用静态或者默认方法弥补了?
是的。
@FunctionalInterface //注解没有报错
public interface IMessageFormat {
String format(String message,String format);
default void test01(){
System.out.println("ABC");
};
static void test02(){
System.out.println("abc");
};
}