Logical Or Operator Example Java Program

Definition

Logical conjunction is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both of its operands are true. The conjunctive identity is 1, which is to say that AND-ing an expression with 1 will never change the value of the expression. In keeping with the concept of vacuous truth, when conjunction is defined as an operator or function of arbitrary arity, the empty conjunction (AND-ing over an empty set of operands) is often defined as having the result 1.

Logical Or Operator Example Program

class LogicalOrOperator{
	public static void main(String[] args){
		int num1,num2;
		num1=43;
		num2=30;
		System.out.println("Input numbers are num1=43 and num2=31");
		if(num1==43||num2==30){
			System.out.println("Atleast one of the two conditions is satisfied.");
		}
	}
}

Sample Output

Output is:
Input numbers are num1=43 and num2=31
Atleast one of the two conditions is satisfied.