Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { // intializing an array arr1 byte[] arr1 = new byte[] { 5, 10, 25 }; System.out.println(Arrays.toString(arr1)); // copying array arr1 to arr2 with range from index 1 to 7 byte[] arr2 = Arrays.copyOfRange(arr1, 1, 7); System.out.println(Arrays.toString(arr2)); } }