Beginner Java with notes--several points of operator 2

Source: Internet
Author: User

1.&& and & Differences

Example: 1>2&&3>2, two && will have to calculate the first half of the result is not in the second half of the operation, know that 1>2 has obtained the result is false, then no longer consider the latter half of the 3>2. | with | |,! and!! Similarly.

2.a+=15 is a=a+15. The first operation is then assigned to the value. and a-=15,a*=15,a/=15 in the same vein.

3. Ternary condition c= (A>B?A:B) can be understood as doubt a>b? If true, the feedback result is a; if it is not, false, then the feedback result is B.

4.String SS = null; Interpreted to define a string SS, which has opened up space but nothing.

String SS = ""; interpreted as defining a string SS, the space that has been opened is empty.

String SS; Interpreted to define a string SS (with possible error).

Beginner Java with notes--several points of operator 2

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.