Here you can find the source of toJava(final double[] doubles)
public static String toJava(final double[] doubles)
//package com.java2s; //License from project: Open Source License public class Main { public static String toJava(final double[] doubles) { final StringBuilder builder = new StringBuilder(20 + doubles.length * 20); toJava(doubles, builder);/*from w w w.ja va2 s. co m*/ return builder.toString(); } /** * * @param doubles * @param builder */ public static void toJava(final double[] doubles, final StringBuilder builder) { if (doubles == null) { builder.append("null"); return; } builder.append("new double[] {"); if (doubles.length > 0) { builder.append(doubles[0]); } for (int i = 1; i < doubles.length; i++) { builder.append(", " + doubles[i]); } builder.append("}"); } }