Nach dem OCA Buch von Jeanne Boyarsky und Scott Selikoff
- Binäre arithmetische Operatoren
- unäre Operatoren
- Zusätzliche binäre Operatoren
- Statements
- Advanced Flow Control
In Java gibt es 3 Ausprägungen von Operatoren: Unary, binary und ternary.
Rangfolge der Operatoren
Shaping | Operator | Symbol |
---|---|---|
Unary | Post-unary operator | expression++, expression-- |
Unary | Pre-unary operator | ++expression, --expression |
Unary | Unary operator | ~, +, -, ! |
tbd | Multiplication/Division/Modulus | *, /, % |
tbd | Shift operators | <<, >>, >>> |
tbd | Relational operators | <, >, <=, >=, instanceof |
tbd | Equal to / not equal to | ==, != |
tbd | Logical operators | &, ^^, I |
tbd | Short-circuit logical operators | &&, II |
tbd | Ternary operators | boolean, expression ? expression1 : expression2 |
tbd | Assignemnt operators | =, +=, *=, /=, %=, ^=, I=, <<=, >>=, >>>= |
Binary Operators sind die am meisten verwendeten Operatoren in Java. Sie können für mathematische Opertionen an Variablend, das Erstellen von logischen Ausdrücken als auch grundsätzliche Variablen- Zuweisungen verwendet werden. Sie werden oftmals in komplexen Ausdrücken mit mehr als 2 Variablen verwendet. Daher ist die Reihenfolge sehr wichtig bei der Auswertung.
Ein Unärer Operator erforder genau einen Operanden.