The logicalOr() method of Java Boolean class returns the result of implementing logical OR operation on the specified Boolean operands.

Syntax:

public static boolean logicalOr (boolean a, boolean b)

Parameters:

The parameters ‘a’ and ‘b’ represents first and second operands.

 Return Value:

The logicalOr () method returns the result after implementing logical OR operation on the parameters a and b.

  • It returns true, if either of the parameter is true.
  • It returns false, if and only if both the parameters are false.

Example 1

Output

Example 2

Output

Example 3

Output

Pin It on Pinterest

Share This