Variables and Data Types

AP Computer Science A· difficulty 2/5

boolean a = true;
boolean b = false;
System.out.println(a && !b);

What is printed?

  • A

    true

    check_circle
  • B

    false

  • C

    0

  • D

    1

Explanation

!b is true, and true && true is true.

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

Related questions