Member-only story
Operators & Expression
Operators in Java
4 min readNov 22, 2020
A symbol that tells the computer to perform a mathematical or logical manipulation. Used in programs to govern information & variables.
Types of Operators
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Assignment Operators
- Increment and Decrement Operators
- Conditional Operators
- Bitwise Operators
- Special Operators
Arithmetic Operators
- The type of result is determined by the types of operanda, not their values.
- This rule applies to all intermediate results in expression.
- If one operand is an int and another is a double, the result is a double; if both operands are ints, the result is an int.
Integer Arithmetic
- When both operands are integers, the expression is an integer expression, the operation is integer arithmetic.
- For modulo division (%), the sign of the result is always the sign first operand.
Real Arithmetic
- When both operands are real, the expression is a…