Java Reference
In-Depth Information
Relational Operators
Operator
Meaning
Example
Value
equal to
==
2 + 2 == 4
true
not equal to
!=
3.2 != 4.1
true
less than
<
4 < 3
false
greater than
>
4 > 3
true
less than or equal to
<=
2 <= 0
false
greater than or equal to
true
>=
2.4 >= 1.6
Logical Operators
Operator
Meaning
Example
Value
AND (conjunction)
&&
(2 == 2) && (3 < 4)
true
OR (disjunction)
||
(1 < 2) || (2 == 3)
true
NOT (negation)
!
!(2 == 2)
false
Operator Precedence
Description
Operators
unary operators
!, ++, --, +, -
multiplicative operators
*, /, %
additive operators
+, -
relational operators
<, >, <=, >=
equality operators
==, !=
logical AND
&&
logical OR
||
assignment operators
=, +=, -=, *=, /=, %=, &&=, ||=
 
 
Search WWH ::




Custom Search