Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 828 Bytes

File metadata and controls

27 lines (22 loc) · 828 Bytes

41 - Boolean

bool Keyword and the possible values are constants true and false

  1. Operators are:

    • ! (logical negation)
    • && (logical conjunction “and”)
    • || (logical disjunction, “or”)
    • == (equality)
    • != (inequality). 
  2. The operators || and && apply the common short-circuiting rules. This means that in the expression f(x) || g(y), if f(x) evaluates to true, g(y) will not be evaluated even if it may have side-effects.


Slide Screenshot

041.jpg


Slide Deck

  • bool Keyword
  • True or False
  • Operators: !, ==, !=, &&, ||
  • Short-circuit: ||, &&
  • Security: Control Flow & Checks, || vs. &&

References