Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { long[] arr1 = new long[] { 5, 60, 75 }; System.out.println(Arrays.toString(arr1)); // copying array arr1 to arr2 with range of index from 2 to 5 long[] arr2 = Arrays.copyOfRange(arr1, 2, 5); System.out.println(Arrays.toString(arr2)); } }