forked from winterbe/java8-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreams9.java
More file actions
21 lines (17 loc) · 422 Bytes
/
Streams9.java
File metadata and controls
21 lines (17 loc) · 422 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.winterbe.java8;
import java.util.Arrays;
/**
* @author Benjamin Winterberg
*/
public class Streams9 {
public static void main(String[] args) {
Arrays.asList("a1", "a2", "b1", "c2", "c1")
.stream()
.filter(s -> s.startsWith("c"))
.map(String::toUpperCase)
.sorted()
.forEach(System.out::println);
// C1
// C2
}
}