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.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        List<String> _names = Arrays.asList("Bob", "Tom", "Jeff", "Scott", "Jennifer", "Steve");

        List<String> greetings = _names.stream().map(name -> "Hello " + name).collect(Collectors.toList());
        System.out.println(greetings);

    }
}