Here you can find the source of listToArray(List
private static double[] listToArray(List<Double> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { private static double[] listToArray(List<Double> list) { double[] arr = new double[list.size()]; for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);/*from w w w. j a va2s. co m*/ return arr; } }