Help the world stop coronavirus! Stay home!

Prev Next

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.

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Access Modifiers

Comments & Discussions