https://www.youtube.com/watch?v=DQVdAQPUkuk&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
What is Stream V2 | Java 8 streams tutorial | Java 8 streams | Streams in Java 8 |
import java.util.Arrays; import java.util.Collection; public class StreamDemo { public static void main(String[] args) { Collection<String> nameList = Arrays.asList("Peter", "John", "Ram"); /* * Following code prints strings greater than length 5 by iterating a * collection. */ nameList.stream().filter(name -> name.length() > 3) .forEach(name -> System.out.println(name)); } }Output
Peter JohnClick the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/StreamDemo_SIT.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StreamDemo_SIT
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/5eb462211ac2fd9fb1bace2049e170a49c5caa69/BasicJava/StreamDemo_SIT/?at=master
See also:
No comments:
Post a Comment