Java tutorial
//package com.java2s; import java.util.List; public class Main { public static String[] subarray(List<String> list, int from, int to) { return list.subList(from, to).toArray(new String[0]); } public static String[] subarray(List<String> list, int from) { return subarray(list, from, list.size()); } public static <V> V[] subarray(V[] type, List<V> list, int from, int to) { return list.subList(from, to).toArray(type); } public static <V> V[] subarray(V[] type, List<V> list, int from) { return subarray(type, list, from, list.size()); } }