- Arithematic operators
- Assignment operators
- comparison operators
- Logical operators
Operator | Description | Example | Result |
+ | Addition | $iknowjavaAdd=2 | 22 |
- | Subtraction | $iknowjavaSub=29 | 21 |
* | Multiplication | $iknowjavaMultiply=54 $iknowjavaMultiply*2 | 108 |
/ | Division | 15/5 | 3 |
% | Modulus (division remainder) | 5%2 | 1 |
++ | Increment | $iknowjavaInc=59 $iknowjavaMultiply++ | x=60 |
-- | Decrement | $iknowjavaDec=90 $iknowjavaDec-- | x=89 |
Operator | Example | Is The Same As |
= | $x=$y | $x=$y |
+= | $x+=$y | $x=$x+$y |
-= | $x-=$y | $x=$x-$y |
*= | $x*=$y | $x=$x*$y |
/= | $x/=$y | $x=$x/$y |
%= | $x%=$y | $x=$x%$y |
Operator | Description | Example |
== | is equal to | 5==8 returns false |
!= | is not equal | 15!=18 returns true |
> | is greater than | 15>18 returns false |
< | is less than | 51<81> |
>= | is greater than or equal to | 51>=81 returns false |
<= | is less than or equal to | 51<=81 returns true |
Operator | Description | E$xample |
&& | and | $x=6 ($x <> 1) returns true |
|| | or | $x=6 ($x==5 || $y==5) returns false |
! | not | $x=6 !($x==$y) returns true |
No comments:
Post a Comment