/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static <T> T[] convertToArray(List<T> values, Class<T> clazz) { for (int i = 0; i < values.size(); i++) { } @SuppressWarnings("unchecked") T[] array = (T[]) object; return array; }
URL: http://download.oracle.com/javase/tutorial/reflect/special/arrayInstance.html