Intern
What logical operations and operators do you know?
sobes.tech AI
Answer from AI
I know the following logical operations and operators in Java:
- Logical "AND":
&&(short-circuit) and&(regular).&&evaluates the second operand only if the first istrue.&always evaluates both operands.
- Logical "OR":
||(short-circuit) and|(regular).||evaluates the second operand only if the first isfalse.|always evaluates both operands.
- Logical "NOT":
!- Inverts the boolean value of the operand.
- Logical "Exclusive OR" (XOR):
^- Returns
trueif the operands have different boolean values.
- Returns
Applicable to boolean types and used in conditional expressions and loops.