Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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));
    }
}