Here you can find the source of copyToArray(List
Parameter | Description |
---|---|
list | The array list to copy from. |
array | The array to copy to (keep same size as list). |
public static float[] copyToArray(List<Float> list, float[] array)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/* www .j av a 2s . c o m*/ * Copies the contents from an array list to an array. * * @param list The array list to copy from. * @param array The array to copy to (keep same size as list). * * @return The copied array. */ public static float[] copyToArray(List<Float> list, float[] array) { for (int i = 0; i < list.size(); i++) { array[i] = list.get(i); } return array; } }