Here you can find the source of join(List
static public String join(List<String> args, String connector)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { static public String join(List<String> args, String connector) { String joined = null;//from w w w . j a v a2s . com for (String part : args) { if (joined == null) { joined = part; } else { joined += connector + part; } } return joined; } }