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) { System.out.println(arr.length); String s = "["; for (int x = 0; x < arr.length; x++) { // System.out.println(x); s += arr[x];//from w w w.j a va2 s . co m if (x != arr.length - 1) { s += ", "; } } s += "]"; return s; } }