Multiple choice java core java

Which of the following best descibes the set of all paires of values for boolean variables a and b such that, (!a && b)==!(a||b) evaluates to true?

  1. 1.Empty set

  2. 2.one pair a==true,b==false

  3. 3.two pairs in which a==true

  4. 4.two paires in which a!=b

  5. 5.All 4possible combination

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The equation (!a && b) == !(a || b) only evaluates true when a is true, regardless of b's value. When a=true, b=false: false == false = true. When a=true, b=true: false == false = true. This gives exactly two pairs where a==true.