Here you can find the source of join(List
public static String join(List<String> list, String separator)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(List<String> list, String separator) { String joined = ""; for (String s : list) { joined += s + separator;//from ww w . ja v a2 s . c om } joined = !list.isEmpty() ? joined.substring(0, joined.length() - separator.length()) : joined; return joined; } }