Here you can find the source of and(boolean val1, boolean val2)
Parameter | Description |
---|---|
val1 | first boolean value |
val2 | second boolean value |
public static boolean and(boolean val1, boolean val2)
//package com.java2s; /*!/*w ww . j a v a 2 s . co m*/ * mifmi-commons4j * https://github.com/mifmi/mifmi-commons4j * * Copyright (c) 2015 mifmi.org and other contributors * Released under the MIT license * https://opensource.org/licenses/MIT */ public class Main { /** * Returns (val1 && val2). * * @param val1 first boolean value * @param val2 second boolean value * @return true if the arguments are true and false otherwise */ public static boolean and(boolean val1, boolean val2) { return val1 && val2; } /** * Returns (vals[0] && vals[1] && ...). * * @param vals boolean values * @return true if the arguments are true and false otherwise */ public static boolean and(boolean... vals) { if (vals == null || vals.length == 0) { return false; } for (boolean val : vals) { if (!val) { return false; } } return true; } }