The conditional operators are:
Table 1. Conditional operators
Operator |
Operation |
== |
Equal |
!= |
Not equal |
> |
Greater than |
< |
Less than |
>= |
Greater than or equal |
<= |
Less than or equal |
The logical operators are:
Table 2. Logical operators
Operator |
Operation |
&& |
AND |
|| |
OR |
! |
NOT |
If you are entering && in an HTML or XML editor you
might have to enter &&
In a conditional expression the terms are evaluated left to right.
The order of precedence of the operators is the same order in which
they are listed in the tables above. You can use parentheses to indicate
the order in which you want expressions to be evaluated. Examples:
Expression: Evaluates to:
(4 > 3) true
!(4 > 3 ) false
(4 > 3) && (8 > 10) false
(4 > 3) || (8 > 10) true