Here you can find the source of join(List
public static String join(List<String> lines, char delim)
//package com.java2s; /**//from ww w . java 2s .c om * Copyright (C) 2016, CERN * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3), copied verbatim in the file "LICENSE". * In applying this license, CERN does not waive the privileges and immunities * granted to it by virtue of its status as Intergovernmental Organization * or submit itself to any jurisdiction. */ import java.util.List; public class Main { public static String join(List<String> lines, char delim) { StringBuilder sb = new StringBuilder(); for (String string : lines) { sb.append(string); sb.append(delim); } return sb.toString(); } }