Compound Boolean Expressions

AP Computer Science A· difficulty 4/5

<code>(false && expensive())</code> evaluates expensive() how often?

  • A

    Once

  • B

    Always

  • C

    Twice

  • D

    Never (short-circuited)

    check_circle

Explanation

<code>&&</code> short-circuits when left is false; right side not evaluated.

Want 10 more like this — adaptive to your weak spots?

Related questions

AP Computer Science A · Compound Boolean Expressions Practice Question | Acemy