-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLambda2.java
More file actions
27 lines (21 loc) · 836 Bytes
/
Copy pathLambda2.java
File metadata and controls
27 lines (21 loc) · 836 Bytes
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
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
public class Lambda2 {
public static void main(String[] args) {
/*new Thread(new Runnable() {
@Override
public void run() {
System.out.println("hello world!");
}
}).start();*/
new Thread(() -> System.out.println("hello world!")).start();
List<String> list=Arrays.asList("json","asdsa","hello","world");
ArrayList<String> list1 = new ArrayList<>();
//list.forEach(str-> list1.add(str.toUpperCase()));
list.stream().map(item->item.toUpperCase()).forEach(System.out::println);
Function<String,String> func=String::toUpperCase;
System.out.println(func.getClass().getInterfaces()[0]);
}
}