Here you can find the source of and(boolean a[], boolean b[])
Parameter | Description |
---|---|
a | the first vector |
b | the second vector |
public static boolean[] and(boolean a[], boolean b[])
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w. j av a 2s . c om * Computes vector whose elements are the results of logical AND of the respective * elements in the two given vectors. * @param a the first vector * @param b the second vector * @return the vector containing logical ANDs of the elements of the two given vectors */ public static boolean[] and(boolean a[], boolean b[]) { boolean[] c = new boolean[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] & b[i]; } return c; } }