• Java Boolean Logical Operators

    Boolean Logical Operators

    Operators
    Name
    &
    Logical AND
    |
    Logical OR
    ^
    Logical XOR
    &&
    Short Circuit AND
    ||   
    Short Circuit OR
    !
    Logical NOT
    &=
    AND Assignment
    |=
    OR Assignment
    ^=
    XOR Assignment
    ==
    equal to
    !=   
    Not Equal to
    ? :
    Ternary operator(if-then-else)




    A
    B
    A &B
    A |B
    A ^B
    A &&B
    A ||B
    True
    True
    true
    True
    false
    True
    true
    True
    False
    False
    true
    True
    False
    True
    False
    True
    False
    True
    True
    False
    True
    false
    false
    False
    false
    False
    false
    False

  • 0 comments:

    Post a Comment