Online Java Compiler By
JavaTpoint.com
public class BooleanLogicalOrExample1 { public static void main(String[] args) { Boolean b1 = true; Boolean b2 = false; // if either of the bool value is true logicalOr() method will return true. boolean b3 = Boolean.logicalOr(b1,b2); System.out.println("1. logicalOr() method for "+b1+" "+b2+" is "+b3); boolean b4 = false; boolean b5 = false; // if both the bool value are true logicalOr() method will return false boolean b6 = Boolean.logicalOr(b4,b5); System.out.println("2. logicalOr() method for "+b4+" "+b5+" is "+b6); } }
Output