Java OCA OCP Practice Question 427

Question

Given the following truth table, which operator for the boolean expressions x and y corresponds to this relationship?

 Table:
 ?                          x = true                  x = false 
     y = true                  true                      false 
     y = false                 false                     false 
  • A. --
  • B. ++
  • C. ||
  • D. &&


D.

Note

The question is about boolean operators.

Since Options A and B are numeric operators, they can be instantly disregarded.

The question then simplifies to which boolean expression, && or ||, corresponds to the truth table that only evaluates to true if both operands are true.

Only the conjunctive logical && operator represents this relationship, making Option D the correct answer.




PreviousNext

Related