Tuesday 26 September 2017

What is Stream V2 | Java 8 streams tutorial | Java 8 streams | Streams in Java 8


Click here to watch in Youtube :
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
StreamDemo.java
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
John

Click 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:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment