You and Snailren together. java-(c) Operator & control Execution Process

Source: Internet
Author: User

"It's a new week, and there's a lot more to learn, come on. Because the third chapter and the fourth chapter content to summarize not many, does not have much need to take out to say, on the integration to a post good "

Operator

What is an operator? Actually, it's +-*/=&^~|. Wait a minute. Also what unary operators, two-dollar operators and so on, these are relatively basic,

For the assignment operator "=", we know that for a constant assignment of a primitive type, the same value is copied directly, and the value is assigned to the destination variable. However, for an assignment to an object, a reference to the object is passed. This also means that for the basic type of assignment, if the original value changes, the new assignment will not change. If the original object changes, the new will also change (@-@).

Another thing to note is the "short-circuit" nature of the logical operator. In fact, this is a relatively basic, in the case of A&&b, if A is false, then B will not be executed. For a| |b, if A is ture, B is not executed.

Shift operation, we know there is >>,<<,>>>. >>> is a special Java, meaning unsigned Right shift, that is, whether positive or negative, high-level are 0. For non-int, such as Char,byte,short, and so on, they will be automatically converted to int, and the result is an int type.

When it comes to conversions, it is important to note that the truncation and rounding issues should be noted in the "narrowing conversion" of type conversions. For example, a float29.7 converted to Int,java will be directly rude interception, the result is 29. If rounding is required, use the math function.

In Java, regardless of the type of machine, the size of the data is the same, so the Java programmer does not need to consider the data size allocation problem when the system is migrated.

You and Snailren together. java-(c) Operator & control Execution Process

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.