-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTProcess.java
More file actions
23 lines (20 loc) · 639 Bytes
/
TProcess.java
File metadata and controls
23 lines (20 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package util.function;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Created by chenxun.
* Date: 2020/10/2 上午12:05
* Description:
*/
public class TProcess {
public static void main(String[] args) {
String[] stringArr = {"you", "me", "she", "he"};
Stream<String> stream1 = Arrays.stream(stringArr);
Stream<String> stream2 = stream1.map(s -> s + "11");
Stream<String> stream3 = stream2.limit(2);
List<String> collect = stream3.collect(Collectors.toList());
collect.forEach(System.out::println);
}
}