Here you can find the source of join(List
public static String join(List<String> strings, String joiner)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static String join(List<String> strings, String joiner) { if (strings.isEmpty()) return ""; StringBuilder sb = new StringBuilder(strings.get(0)); for (int i = 1; i < strings.size(); i++) sb.append(joiner).append(strings.get(i)); return sb.toString(); }/*ww w . j av a2 s .c o m*/ }