Here you can find the source of join(int[] arr, String delimiter)
public static String join(int[] arr, String delimiter)
//package com.java2s; public class Main { public static String join(String delimiter, String[] strings) { if (strings.length == 0) { return ""; }/*w w w .j a v a2 s . c om*/ StringBuilder stringBuilder = new StringBuilder(); for (String str : strings) { stringBuilder.append(" ").append(str); } return stringBuilder.substring(1); } public static String join(int[] arr, String delimiter) { if (arr.length == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (int i : arr) { sb.append(delimiter).append(Integer.toString(i)); } return sb.substring(delimiter.length()); } }