All relational operators are binary operators. They take two operands.
The result produced by a relational operator is a Boolean value true or false.
The following table lists the relational operators available in Java.
Operators | Meaning | Type | Usage | Result |
---|---|---|---|---|
== | Equal to | Binary | 3 == 2 | false |
!= | Not equal to | Binary | 3 != 2 | true |
> | Greater than | Binary | 3 > 2 | true |
>= | Greater than or equal to | Binary | 3 >= 2 | true |
< | Less than | Binary | 3 < 2 | false |
<= | Less than or equal to | Binary | 3 <= 2 | false |