"Song Hongkang Learning Diary 3" operator

Source: Internet
Author: User
Tags arithmetic operators bitwise operators

Long time no see, today let's briefly talk about the operator's story.

The operators are first divided into arithmetic operators, logical operators, bitwise operators, relational operators, and ternary operators.

Arithmetic operators have +-*0%. Notice the difference between s=s+5 and s+=5.

Comparison operator: = = >= <=! = instanceof

Logical operators are | | | & && ^. Need to be aware that | | | The difference between & && (short circuit and).

B is also judged when a&b:a is false;

When the a&&b:a is false, the whole is false,b not allowed to shoot the segment.  (| | | In the true case).

Bitwise operators in << >> >>> |^ ~, bitwise operators |, ^ and the arithmetic operator ^ are different at both ends of the bitwise operator are numeric operations, arithmetic is a Boolean. >>, if the negative, the left and right shift 1, positive 0;

Ternary operator: (condition)? Expression 1: Expression 2.

"Song Hongkang Learning Diary 3" operator

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.