Created
October 10, 2016 11:51
-
-
Save sarbull/a44b9877cae5ea1bc6d450c9d3e62cc1 to your computer and use it in GitHub Desktop.
Java Streams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package learning; | |
import java.util.*; | |
public class Main { | |
public static void main(String [] args) { | |
System.out.println("Hello world!"); | |
List<String> myList = Arrays.asList("a1", "a2", "c3", "c5", "cezar", "ana", "constanta"); | |
myList | |
.stream() | |
.filter(s -> s.startsWith("c")) | |
.map(String::toUpperCase) | |
.sorted() | |
.forEach(System.out::println); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment