Here you can find the source of arrayToString(int[] subset)
public static String arrayToString(int[] subset)
//package com.java2s; //License from project: Open Source License public class Main { public static String arrayToString(int[] subset) { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < subset.length - 1; ++i) sb.append(subset[i] + ","); sb.append(subset[subset.length - 1] + "]"); return sb.toString(); }/*w w w. j av a2 s . c o m*/ public static String arrayToString(double[] subset) { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < subset.length - 1; ++i) sb.append(subset[i] + ","); sb.append(subset[subset.length - 1] + "]"); return sb.toString(); } public static String arrayToString(Object[] subset) { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < subset.length - 1; ++i) sb.append(subset[i].toString() + ","); sb.append(subset[subset.length - 1].toString() + "]"); return sb.toString(); } }