Here you can find the source of arrayToString(double... a)
public static String arrayToString(double... a)
//package com.java2s; //License from project: LGPL public class Main { public static String arrayToString(double... a) { StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]);/*from www .j a v a 2s .c om*/ for (int i = 1; i < a.length; i++) { result.append(","); result.append(a[i]); } } return "[" + result.toString() + "]"; } public static String arrayToString(int... a) { StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]); for (int i = 1; i < a.length; i++) { result.append(","); result.append(a[i]); } } return "[" + result.toString() + "]"; } public static String arrayToString(Object... a) { StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]); for (int i = 1; i < a.length; i++) { result.append(","); result.append(a[i]); } } return "[" + result.toString() + "]"; } }