Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

import java.util.function.Function;

import java.util.stream.Collectors;

public class Main {
    public static <T> String getCommaSeparatedNames(List<T> list, Function<T, String> function) {
        return list.stream().map(function).collect(Collectors.joining(","));
    }
}