Working with Comparison Operators

In this section, you will learn about the comparison operators in Java.

Operator Description
< Lesser than
> Greater than
<= Lesser than or equal
>= Greater than or equal

Lesser

Returns true if the operand on the left is lesser than the operand on the right.

Greater

Returns true if the operand on the left is greater than the operand on the right.

Lesser Than Or Equal

Returns true if the operand on the left is lesser than or equal to the operand on the right.

Greater Than Or Equal

Returns true if the operand on the left is greater than or equal to the operand on the right.