Here you can find the source of arrayToString(int[] arr)
public static String arrayToString(int[] arr)
//package com.java2s; //License from project: Open Source License public class Main { public static String arrayToString(int[] arr) { if (arr == null || arr.length == 0) { return ""; }/* ww w . j a v a 2s .c o m*/ String str = "["; for (int i = 0; i < arr.length - 1; i++) { str += arr[i] + ","; } str += arr[arr.length - 1] + "]"; return str; } }