What is De Morgan's Law in the context of boolean expressions in Java?
Instructor solution
De Morgan's Law is a set of transformation rules that can be applied to boolean expressions in Java. The laws state that the negation of a conjunction is the disjunction of the negations, and the negation of a disjunction is the conjunction of the negations. In simpler terms, !(A && B)
is equivalent to (!A || !B)
, and !(A || B)
is equivalent to (!A && !B)
.
You may exit out of this review and return later without penalty.