Long time no see, today let's briefly talk about the operator's story.
The operators are first divided into arithmetic operators, logical operators, bitwise operators, relational operators, and ternary operators.
Arithmetic operators have +-*0%. Notice the difference between s=s+5 and s+=5.
Comparison operator: = = >= <=! = instanceof
Logical operators are | | | & && ^. Need to be aware that | | | The difference between & && (short circuit and).
B is also judged when a&b:a is false;
When the a&&b:a is false, the whole is false,b not allowed to shoot the segment. (| | | In the true case).
Bitwise operators in << >> >>> |^ ~, bitwise operators |, ^ and the arithmetic operator ^ are different at both ends of the bitwise operator are numeric operations, arithmetic is a Boolean. >>, if the negative, the left and right shift 1, positive 0;
Ternary operator: (condition)? Expression 1: Expression 2.
"Song Hongkang Learning Diary 3" operator