Page 12 - PowerPoint Presentation
P. 12

Logical Operator











            o Logical operator takes logical expressions as operands



            o Logical operator in Java : && (AND), || (OR) & ! (NOT)





                                      A (expr)           B                  A && B            A || B              !A                !B
                                                         (expr)



                                      False              False              False             False              True               True



                                      False              True               False             True               True               False


                                      True               False              False             True               False              True


                                      True               True               True              True               False              False
   7   8   9   10   11   12   13   14   15   16   17