Here you can find the source of doubleArray(int... in)
public static String doubleArray(int... in)
//package com.java2s; //License from project: Open Source License public class Main { public static String doubleArray(int... in) { String out = "[ "; for (int d : in) { out += (d + " , "); }/* w ww . ja va2s .c o m*/ //Magic number 2 stems from the wish to remove the ", " from the end of the string. //If the for-loop was never entered however, out.lenght == 2. In that case, we do nothing out = out.substring(0, out.length() - 2 > 0 ? out.length() - 2 : 2); return out + "]"; } }