Java - Operator Relational Operators

What are Relational Operators?

All relational operators are binary operators. They take two operands.

The result produced by a relational operator is a Boolean value true or false.

Java Relational operators

The following table lists the relational operators available in Java.

Operators Meaning Type UsageResult
== Equal to Binary 3 == 2 false
!= Not equal to Binary 3 != 2 true
> Greater than Binary 3 > 2true
>= Greater than or equal to Binary 3 >= 2 true
< Less thanBinary 3 < 2false
<= Less than or equal toBinary 3 <= 2 false