69
Java Boolean logicalOr() Method
The logicalOr() method of Java Boolean class returns the result of implementing logical OR operation on the assigned boolean operands.
Syntax:
Parameters:
a – This is the first Boolean operand
b – This is the second Boolean operand
Return Value:
The logicalOr() method returns the result of applying logical OR operation on Boolean parameters a and b.
Example 1
Output:
1. logicalOr() method for true false is true 2. logicalOr() method for false false is false
Example 2
Output:
Enter the number whose table you want to print: 119 Please enter a valid number between 0-20.
Example 3
Output:
Q How many hours are there in a day? Ans: 67 Answer is wrong.
Next TopicJava Boolean