Java List to Array toArray(List list)

Here you can find the source of toArray(List list)

Description

Method for turning a list of doubles to an array.

License

Open Source License

Parameter

Parameter Description
list List of doubles

Return

Array of doubles.

Declaration

private static double[] toArray(List<Double> list) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    /**//from ww  w .  ja v  a2  s.  c o  m
     * Method for turning a list of doubles to an array.
     *
     * @param list List of doubles
     * @return Array of doubles.
     */
    private static double[] toArray(List<Double> list) {
        double[] values = new double[list.size()];
        for (int i = 0; i < values.length; i++) {
            values[i] = list.get(i);
        }
        return values;
    }
}

Related

  1. toArray(List lista)
  2. toArray(List list)
  3. toArray(List data)
  4. toArray(List list)
  5. toArray(List list)
  6. toArray(List values)
  7. toArray(List enums)
  8. toArray(List from, int[] to)
  9. toArray(List l)