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