Java tutorial
//package com.java2s; import java.lang.reflect.Array; import java.util.List; public class Main { public static Object toArray(List<?> list, Class<?> componentType) { Object result = Array.newInstance(componentType, list.size()); System.arraycopy(list.toArray(), 0, result, 0, list.size()); return result; } }