Here you can find the source of join(List list, char separator)
public static String join(List list, char separator)
//package com.java2s; import java.util.List; public class Main { public static String join(List list, char separator) { if (list == null) { return ""; }/* w w w . j ava2 s .c o m*/ int size = list.size(); if (size == 0) { return ""; } if (size == 1) { return String.valueOf(list.get(0)); } final StringBuilder sb = new StringBuilder(); boolean notfirst = false; for (Object item : list) { if (notfirst) { sb.append(separator); } else { notfirst = true; } sb.append(item); } return sb.toString(); } }