Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

    public static void main(String[] args) throws Exception {
        // map
        List<String> words = Arrays.asList("Hello", "World");

        words.stream().flatMap((String line) -> Arrays.stream(line.split(""))).distinct()
                .forEach(System.out::println);

    }

}