Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class Main {

    public static void main(String[] args) {
        List<String> liste = Arrays.asList("XML", "HTML", "CSS", null);

        liste.parallelStream()// Parallel stuff uses Fork-Join
                .filter(e -> (!Objects.equals(e, null))) // lazy & parallel
                .filter(e -> (e.length() > 3)) // lazy & parallel
                .forEach(e -> { // sequential & eagerly
                    System.out.println("Bigger length than 3 in List: " + e);
                });

    }
}