Here you can find the source of subarray(int[] array, int start, int end)
static int[] subarray(int[] array, int start, int end)
//package com.java2s; // license that can be found in the LICENSE file. public class Main { static int[] subarray(int[] array, int start, int end) { int[] r = new int[end - start]; for (int i = start; i < end; ++i) { r[i - start] = array[i];/*www.j a va 2 s .c om*/ } return r; } static byte[] subarray(byte[] array, int start, int end) { byte[] r = new byte[end - start]; for (int i = start; i < end; ++i) { r[i - start] = array[i]; } return r; } }