Problems with operator and expression attention
Java operators and expressions include arithmetic operators and expressions, logical operators and expressions, logical operators, bitwise operators, and so on.
(1) A logical operator is a short-circuit operator, such as OP1 | | OP2, when OP1 is true, OP2 is no longer considered, OP1&&OP2, OP1 is not considered when OP2 is false.
(2) The logic bit operation differs from the short-circuit characteristic of the logical operator, OP1 | OP2, the arithmetic will calculate the OP1 and OP2, and give the result of the bit operation.
(3) The function of encryption and decryption can be realized by using the XOR operation of the c=a^b,a=c^b two times logic bit operation.
(4) The instanceof operator can be used to determine whether the object on the left is created by the right-hand class.
Issues to be aware of in Java statements
Java statements include control statements, loop statements, break and continue statements, and control statements include conditional control statements (if statements), switch statements, and loop statements including for statements, while and do: While statement.
(1) in the switch statement, and the expression has been in the case of the sentence if there is a break, the execution of this case statement to jump out of the switch statement; Until the execution finishes or encounters a break jump.
(2) The break statement and the continue statement are different: The break statement is to jump out of the loop, continue statement is to skip this cycle, do not perform the following continue the cycle of the program.
Summary of issues needing attention in Java operators and expressions and Java statements