Java Operators Complete Guide
Java Operators
Symbols performing operations on operands with specific precedence.
Operators Example
int a = 10, b = 3; int sum = a + b; // 13 boolean result = a > b; // true int mod = a % b; // 1 String grade = (a > 8) ? "Pass" : "Fail";
Key Points
- Arithmetic: +, -, *, /, %.
- Relational: ==, !=, >, <, >=, <=.
- Logical: && (AND), || (OR), ! (NOT).
- Ternary:
condition ? trueValue : falseValue.