Here you can find the source of join(List
public static String join(List<String> strings, String separator)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String join(List<String> strings, String separator) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String string : strings) { if (!first) { sb.append(separator);/*w ww. j a v a2 s . c om*/ } else { first = false; } sb.append(string); } return sb.toString(); } }