Summary of issues needing attention in Java operators and expressions and Java statements

Source: Internet
Author: User
Tags arithmetic arithmetic operators bitwise operators case statement logical operators
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.