Here you can find the source of join(List
public static String join(List<Integer> array, char c)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(List<Integer> array, char c) { final StringBuilder sb = new StringBuilder(); for (int value : array) { if (sb.length() > 0) { sb.append(c);/*from ww w .ja v a 2 s.co m*/ } sb.append(Integer.toString(value)); } return sb.toString(); } }