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