函数式接口详细定义 package java.lang; import java.lang.annotation.*; /** * An informative annotation type used to indicate that an interface * type declaration is intended to be a <i>functional interface</i> as * defined by the Java Language Specificat…
Lamb表达式匿名类实现接口方法 import java.util.ArrayList; public class HandlerDemo{ public static void main(String[] args) { ArrayList<Object> list = new ArrayList<>(); // 测试匿名类实现doBusy方法 new HandlerDemo().testHandler(() -> { list.add("测试匿名类实现doBus…