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