Arrays.copyOfRange(boolean[] original, int from, int to) has the following syntax.
public static boolean[] copyOfRange(boolean[] original, int from, int to)
In the following code shows how to use Arrays.copyOfRange(boolean[] original, int from, int to) method.
/* ww w .j a va 2 s.c o m*/ import java.util.Arrays; public class Main { public static void main(String[] args) { boolean[] arr1 = new boolean[] { true, false, false }; System.out.println(Arrays.toString(arr1)); // copying array arr1 to arr2 with range from index 1 to 4 boolean[] arr2 = Arrays.copyOfRange(arr1, 1, 4); System.out.println(Arrays.toString(arr2)); } }
The code above generates the following result.