Java Learning essay (ii.)

Source: Internet
Author: User

Operator: also called operator, is a symbol for operations, which acts on one or more operands (data that participates in the Operation)

The operator is divided by the number of operands: unary (mesh) operator, two (mesh) operator, ternary (mesh) operator

The functions of the operators are divided into arithmetic operators (for mathematical operations), logical operators (used to determine true and false), bitwise operators (FOR binary operations), and other

In the case of multiple operator operations: the higher the precedence operator, the precedence is performed, and the operators with the same precedence are executed sequentially from left to right

Common scenarios using multiple operators: assignment operations, mathematical operations, type conversions and function calls, logical operations, Trinocular operations, Other operations

Assignment operations: always last run, mathematical operations: in mathematical order of operations, type conversions and function Calls: first the function call in the conversion type, the logical operation: will && and | | Two-way expressions are considered as a whole, and in other operations: the order of operations is controlled using parentheses or separate writing.

Expression: a meaningful statement that contains at least one operand and one operator, each of which has a return type, and each expression can be manipulated with other expressions as long as the type meets the requirements

Bitwise operators have:& (and), | (or), ^ (xor),<< (shift left),>> (shift right), ~ (fetch)

The trinocular operator is also called the ternary operator, he needs three operands to participate in the operation, writing: operand 1? operand 2: operand 3

If the operand 1 determines that the result is true, the operand 2 is the return value, and if the operand 1 determines that the result is false, the operand 3 is the return Value.

Common logical operators: = = (equals),! = (not equal to),> (greater than), >= (greater than or equal),< (less than), <= (less than equals),&& (and), | | (or),! Non-

Java has a variety of looping methods: for while foreach Dowhile

Java Learning essay (ii.)

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.