Here you can find the source of join(String delimiter, short[] array)
short
s, separated by a delimiter.
public static String join(String delimiter, short[] array)
//package com.java2s; /*// www. j a v a2s . co m * Copyright (C) 2012 Krawler Information Systems Pvt Ltd * All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import java.util.Collection; public class Main { /** * Joins an array of <code>short</code>s, separated by a delimiter. */ public static String join(String delimiter, short[] array) { if (array == null) { return null; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < array.length; i++) { buf.append(array[i]); if (i + 1 < array.length) { buf.append(delimiter); } } return buf.toString(); } /** * Joins an array of objects, separated by a delimiter. */ public static String join(String delimiter, Object[] array) { if (array == null) { return null; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < array.length; i++) { buf.append(array[i]); if (i + 1 < array.length) { buf.append(delimiter); } } return buf.toString(); } public static <E> String join(String delimiter, Collection<E> col) { if (col == null) { return null; } Object[] array = new Object[col.size()]; col.toArray(array); return join(delimiter, array); } }