Here you can find the source of toFloatArray(List
public static float[] toFloatArray(List<Float> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static float[] toFloatArray(List<Float> list) { if (isNullOrEmpty(list)) { return null; }/*from ww w. j a v a2 s . c o m*/ float[] floats = new float[list.size()]; for (int i = 0; i < floats.length; i++) { floats[i] = list.get(i); } return floats; } public static boolean isNullOrEmpty(Collection c) { return c == null || c.isEmpty(); } public static boolean isNullOrEmpty(String s) { return s == null || s.isEmpty(); } }