Learning Note 4

Source: Internet
Author: User

One, the automatic promotion of the Java expression type

1. All byte, short, and char types will be promoted to the int type.

2. The data type of the entire arithmetic expression is automatically raised to the same type as the highest-level operand in the woo representation.

The type of the expression is strictly persisted and the same type as the highest-level operand in the expression

Ii. the difference between ++a and a++

Self-added. This is a single-mesh operator that can appear to the left of the operand or to the right. But the effect is not the same. If you put the + + on the left, then the operand is added 1, then the operand is put into the expression, if the + + is placed on the right, then the operand is put in the expression operation, and then the operand is added 1.

Three, a=a+7 and A + = 7 difference

Although the two are identical in the result of running, there are some differences in the operating mechanism of the bottom layer. Therefore, if you can

With this extended operator, this extended operator is used.

Four, comparison operators

Comparison operators are used to determine the size of two variables or constants, and the result of a comparison operation is a Boolean value

Learning Note 4

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.