Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static double[][] toArray1(ArrayList<Double> a) { int dataDimen = a.size(); double[][] res = new double[1][dataDimen]; for (int i = 0; i < dataDimen; i++) { res[1][i] = a.get(i); } return res; } }