Java Boolean logicalXor() MethodThe logicalXor() method of Boolean class returns the result of implementing logical XOR operation on the assigned Boolean operands. Syntax:Parameters:The parameters passed are a (first Boolean operand) and b (second Boolean operand). Return Value:The logicalXor() method returns the result of applying logical XOR operation on Boolean parameters a and b.
Example 1Test it NowOutput: 1. logicalXor() method for true false is true 2. logicalXor() method for true true is false 3. logicalXor() method for false false is false Example 2Output: Enter your age 45 logical Xor is true You are an adult. You are eligible to vote. Example 3Output: Enter two no.s I no : 45 II no : 89 89 is greater Next TopicJava Boolean |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India