Java / Control Statements
What is tautology and contradiction in boolean expressions?
The tautology refers to a logical expression which always evaluates to true, regardless of the logical value of its variables.
For example, consider the below expresion in Java.
boolean isTrue = true; if (! (! (isTrue) )) { }
In the above example, applying NOT operation twice (double negation) does not impact the expression value and it always returns true. This is an example of tautology.
On the other hand, contradiction refers to the opposite of tautology, that is, the expression will always return false.
More Related questions...