Here you can find the source of subArray(final int[] input, final int start, final int end)
Parameter | Description |
---|---|
input | - the input int array |
start | - the start index |
end | - the end index |
public static int[] subArray(final int[] input, final int start, final int end)
//package com.java2s; public class Main { /**/* w w w. j a va 2 s . c om*/ * Generates a subarray of a given int array. * * @param input - * the input int array * @param start - * the start index * @param end - * the end index * @return a subarray of <tt>input</tt>, ranging from <tt>start</tt> to * <tt>end</tt> */ public static int[] subArray(final int[] input, final int start, final int end) { int[] result = new int[end - start]; System.arraycopy(input, start, result, 0, end - start); return result; } }