4 questions on Java 8 Streams

List<Integer> list = new ArrayList<Integer>();Stream<Integer> stream = evens.stream();
List<String> names = new ArrayList<String>(Arrays.asList("alex", "brian", "charles"));Stream<String> = names.stream()
.map(s->s.toUpperCase());
List<Integer> list = new ArrayList<Integer>(Arrays.asList(1,3,5,7,9));Stream<Integer> stream = list.stream();//Terminal operation is called
stream.forEach(s->{System.out.println(s);});
//Intermediate operation gives a java.lang.IllegalStateException stream.filter(s -> s > 5);

A key driver for this work is making parallelism more accessible to developers.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mehmet Akcay

Mehmet Akcay

a geek who loves to understand the reasons behind things... and colors... Colors are cool.