Operators operate on operands and cause changes in the operand value or give a new value. Java provides operators in four catagories.
- Arithmatic Operator
- Bitwise Operator
- Relational Operator
- Logical Operator
Arithmetic Operators:
| Operation | Operator Symbol |
| Add | + |
| Subtract | - |
| Multiply | * |
| Divide | / |
| Modulus | % |
Bitwise Operators:
Bitwise operators are used to manipulate individual bits of a data item. there are situations where individual bits of a data are to be modified. These operators operates only on byte, char, short, int and long types.
| Operation | Operator Symbol |
| Bitwise NOT | ~ |
| Bitwise AND | & |
| Bitwise OR | | |
| Bitwise XOR | ^ |
| Left Shift | << |
| Right Shift | >> |
| Right Shift Zero Fill | >>> |
Relational Operators:
| Operation | Operator Symbol |
| Equal to | == |
| Not Equal to | != |
| Greater Than | > |
| Greater than or equal to | >= |
| Less than | < |
| Less than or equal to | <= |
Logical Operators:
| Operation | Operator Symbol |
| Equal to | == |
| Logical AND | & |
| Logical OR | | |
| Logical XOR | ^ |
| Short-circuit AND | && |
| Short-circuit OR | || |
| Logical unary NOT | ! |
| Not equal to | != |
| Ternary if-else | ?: |



10:47 PM
Tammy Kings
0 comments:
Post a Comment