Relations between two numeric expressions are determined using the following operators:
> |
greater than |
>= |
greater than or equal to |
< |
less than |
<= |
less than or equal to |
You can test if two operands (primitive or objects) are equal using the two operators:
== |
equal to |
!= |
not equal to |
For example, to test if the string message msg equals "Wake up!" you should write:
msg.equals( "Wake up!" )
a = 5 means assign value of 5 to the variable a, whereas
a == 5 is true if a equals 5 and false otherwise
The result of all comparison operations is of boolean type (true or false).