Category | Operators |
---|---|
Postfix | expr++ , expr-- |
Unary | ++expr , --expr , +expr , -expr , !expr , ~expr |
Multiplicative | * , / , % |
Additive | + , - |
Shift | << , >> , >>> |
Relational | < , > , <= , >= , instanceof |
Equality | == , != |
Bitwise AND | & |
Bitwise XOR | ^ |
Bitwise OR | ` |
Logical AND | && |
Logical OR | ` |
Conditional (Ternary) | ? : |
Assignment | = , += , -= , *= , /= , %= |
Compound Shift | <<= , >>= , >>>= |
Compound Bitwise | &= , ^= , ` |
Implicit Casting (Widening):
Explicit Casting (Narrowing):
This type of casting must be done manually by the programmer.
It is used when converting from a larger data type to a smaller data type.
It may result in a loss of precision or data.
We can also convert STRING into any datatype using a reference type
DataType.parseDataType(STRING)