Java 8 – Streams API

1. Context 

One of the most interesting features and new functionality to come out of the Java 8 release, in my opinion. java.util.stream  is a package of classes which support the function-style operations on streams of elements. Here are simple examples below on how streams can be used with Collections.  

2. What can you do with streams? 

2.1 Filter 

2.2 Sort 

2.3 All Match  

2.4  Any Match 

2.5 No Match 

2.6 Max  

2.7 Min 

2.8 Group  

Final thoughts 

Code example can be found here.

 

Leave a Reply

Your email address will not be published. Required fields are marked *