1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//Runnable无参无返回值

@Functionallnterface

public interface Runnable{

public abstract void run();

}

//Function<T,R>接受一个参数,并且有返回值

@Functionallnterface

public interface Function<T,R>{

R apply(T t);

}

//Supplier没有参数,有一个返回值

@Functionallnterface

public interface Supplier<T>{

T get();

}

//Consumer接受一个参数,没有返回值

@Functionallnterface

public interface Consumer<T>{

void accept(T t);

}

//BiConsumer<T,U>接受两个参数(Bi,英文单词词根,代表两个的意思),没有返回值

@Functionallnterface

public interface BiConsumer<T,U>{

void accept(T t,U u);

}

1. JDK20

https://www.java.com/releases/
https://www.infoq.cn/article/0axykmqvf5lhzseqtjbp

image.png

2. 实战经验

3. 参考与感谢