We have already encountered the equals relational operator ==. Listed next are all the relational
operators.
> greater than
>= greater than or equal to
< less than
<= less than or equal to
These are all of equal precedence. The remaining two operators are of lower precedence.
== equals
!= not equals
The precedence rules mean that in the following code fragment:
int a = S, b = 4;
boolean c = true;
if (a > b == c) {
System. out. println("Condition true") ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.