Here you can find the source of join(List> list)
public static String join(List<?> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { private static final char COMMA = ','; public static String join(List<?> list) { StringBuilder sb = new StringBuilder(); if (list != null) { int size = list.size(); if (size > 0) { sb.append(list.get(0));//from ww w . j av a2s.c om } for (int i = 1; i < size; i++) { sb.append(COMMA).append(list.get(i)); } } return sb.toString(); } }