Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static double[] toDoubleArray(Collection<? extends Number> c) { double arr[] = new double[c.size()]; int i = 0; for (Number item : c) { arr[i++] = item.doubleValue(); } return arr; } }