Compare Two Java boolean Arrays - Java Language Basics

Java examples for Language Basics:boolean

Description

Compare Two Java boolean Arrays

Demo Code

 
import java.util.Arrays;
 
public class Main {
 
  public static void main(String[] args) {
    boolean[] blnArray1 = new boolean[]{true,false,true};
    boolean[] blnArray2 = new boolean[]{true,false,true};
   /*  w  ww .j ava  2  s  .co m*/
    boolean blnResult = Arrays.equals(blnArray1,blnArray2);
    System.out.println("Are two boolean arrays equal ? : " + blnResult);
   
  }
}

Result


Related Tutorials