Android examples for java.lang:array copy
copy Of Range in an array
import java.lang.reflect.Array; import java.util.List; public class Main{ public static int[] copyOfRange(int[] original, int start, int end) { if (start <= end) { if (original.length >= start && 0 <= start) { int length = end - start; int copyLength = Math.min(length, original.length - start); int[] copy = new int[length]; System.arraycopy(original, start, copy, 0, copyLength); return copy; }//from ww w . ja va2 s. c om throw new ArrayIndexOutOfBoundsException(); } throw new IllegalArgumentException(); } }