Here you can find the source of join(String separator, List extends Object> items)
public static String join(String separator, List<? extends Object> items)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(String separator, List<? extends Object> items) { return join(separator, items.toArray(new Object[items.size()])); }/*ww w. j av a2 s. c om*/ public static <T> String join(String separator, T... items) { return join(separator, 0, items); } public static <T> String join(String separator, int offset, T... items) { StringBuffer buf = new StringBuffer(); for (int i = offset; i < items.length; i++) { buf.append(items[i]); if (i < items.length - 1) { buf.append(separator); } } return buf.toString(); } }