Here you can find the source of intArrayToString(int[] iarray, int count)
public static String intArrayToString(int[] iarray, int count)
//package com.java2s; public class Main { /**//from w w w .ja v a 2s. c o m * Put array values in parentheses separated by commas. */ public static String intArrayToString(int[] iarray, int count) { if (count > 0) { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < count; i++) { sb.append(iarray[i]); if (i < count - 1) sb.append(", "); } sb.append("]"); return sb.toString(); } else { return "[null]"; } } }