Here you can find the source of join(List
public static String join(List<String> strings, String separator)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String join(List<String> strings, String separator) { if (strings == null) { return ""; }/*from ww w . ja v a 2 s.c o m*/ StringBuffer sb = new StringBuffer(); for (int i = 0, m = strings.size(); i < m; i++) { String string = strings.get(i); if (string == null) { string = ""; } sb.append(string); if (i + 1 < m) { sb.append(separator); } } return sb.toString(); } }