copyOf


Description:

public static int[] copyOf (int[] arr, int newLen)

Copies an int array with a new length.

New trailing elements are zero when expanded.

Parameters:

arr

source array.

newLen

target length (must be >= 0, otherwise empty array).

Returns:

copied array.