01 2023 档案
摘要:函数式接口 函数式接口:有且仅有一个抽象方法的接口。 使用@FunctionalInterface注解来标记。如果接口不是函数式接口就会编译出错 满足条件的接口即使不加上注解,那也是函数式接口 函数式接口可以作为方法的参数 public static void main(String[] args)
阅读全文
摘要:@Builder 是 lombok 中的注解。可以使用builder()构造的Person.PersonBuilder对象进行链式调用,给所有属性依次赋值。 Person person1 = Person.builder() .name("张三") .age(20) .build(); System
阅读全文