Here you can find the source of printArray(T[] array)
public static <T> String printArray(T[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static <T> String printArray(T[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]);/* w w w . j av a 2 s .c om*/ return builder.toString(); } public static <T> String printArray(T[] array, String message) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); builder.append(message); return builder.toString(); } public static String printArray(int[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(long[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(float[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(double[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(char[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(byte[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(short[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } public static String printArray(boolean[] array) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); } }