Java Boolean Array And and(boolean[] x, boolean[] y)

Here you can find the source of and(boolean[] x, boolean[] y)

Description

and

License

Apache License

Declaration

public static boolean[] and(boolean[] x, boolean[] y) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean[] and(boolean[] x, boolean[] y) {
        if (x == null || y == null || x.length != y.length)
            return null;

        boolean[] result = new boolean[x.length];
        for (int i = 0; i < x.length; i++) {
            result[i] = x[i] & y[i];
        }//  w w w. ja v a  2s  .c om
        return result;
    }
}

Related

  1. and(boolean a[], boolean b[])
  2. and(boolean[][] b1, boolean[][] b2)
  3. andRows(boolean[][] data)
  4. ANDWith(boolean[] toChange, boolean[] toAdd)