1. Operators
1.1, arithmetic operator + ( addition has three usages: addition, plus, String connector )-*/% + +--
1.1.1,/is the pickup,% is the surplus
Usage of 1.1.2, + + and--(A: function is self-increment, self-subtraction)
B: used alone: in front and back
C: Participate in operation using:
put in front is to increment or subtract first, then participate in the Operation
int A=10;int b=++a;-----------b=11
In the back is the first to participate in the operation, and then self-increase or reduce
int A=10;int b=a++; ----------b=10
1.2, assignment operator (=,+=,-=,*=,/=,%=) = is the most basic assignment operator int x=10; assigns 10 to X;
Knowledge Points:+=,-=,*=,/=,%= Implicit automatic casts
such as: Short S=1; s=s+1; Error, because the int to short needs a strong turn
Short s1=1;s1+=1;//Auto-strong ( implied ) ===== (short) (s1+1)
1.3. Comparison operator (= = = > < >= <=) The result is a Boolean
1.4. Logical Operators (& | ^ ! && | | The expression used to concatenate the result is Boolean
int a=10;
int b=20;
int c=30;
Conclusion:& logic and: there is false and false, only true if it is full.
| Logical OR: TRUE if True
^ Logical XOR is the same as false, different true, couple relationship.
! False if not true, true if not false.
&& False is true only if it is true: only it will short-circuit if the previous condition is not satisfied, the latter one will not execute at all
|| Logical OR: There is true if true, except that it will short-circuit if the previous one is true and the latter one will not execute at all.
1.5, bitwise operations (>> << >>> <<<< ^ | &)
^ One data for another data bit XOR or two times, the number does not change as 2^5^5===2
--To be continued
Java Fundamentals Review II: Operators, keyboard entry, flow control statements, if statements, ternary operations