- Arithmetic operators
- Arithmetic operators are primarily used for basic arithmetic operations such as addition, subtraction, multiplication, division, etc.
- Assignment operators
- An assignment operator is a symbol that specifies a numeric value for a variable or constant. If you can use "=" to assign the result of the right expression to the left operand.
- Comparison operators
- The comparison operator is used to determine the size of two data, for example: greater than, equal to, not equal to. The result of the comparison is a Boolean value (True or false).
- logical operators
- Logical operators are primarily used for logical operations.
- 1, with : All is true, just for true
2, or : One is true, then true
3, non : True logic non-operation is false, false logic non-operation is true
4, xor : There is only one true, then true
"Short-circuit phenomenon" in Java: The logical value of the entire logical expression can be determined, the short-circuit
- Logical expression 1 && logical expression 2: If logical expression 1 is false, logical expression 2 does not execute
- Logical Expression 1 | | Logical expression 2: logical expression 2 does not execute if the logical expression is 1-bit true
- Conditional operators
- The conditional operator (? :) also known as the ternary operator.
- Syntax form: boolean expression? Expression 1: Expression 2
- Operation procedure: Returns the value of expression 1 If the value of the Boolean expression is true , otherwise returns the value of expression 2
- operator's [priority] issue
- Level 1 has the highest priority, and level 11 has the lowest priority.
Java Common operation symbols