Java operator Precedence

Source: Internet
Author: User
Tags bitwise bitwise operators integer division

Unary operators > Arithmetic operators > Shift operators > Logical operators > Bitwise operators > Assignment operators

Serial number

Symbol

Name

Adhesion (with operands)

Mesh number

Description

1

.

Point

From left to right

Binocular

( )

Parentheses

From left to right

[ ]

Square brackets

From left to right

2

+

Positive sign

From right to left

Monocular

-

Minus sign

From right to left

Monocular

++

Self-increment

From right to left

Monocular

Prefix increment, suffix increment

- -

Self-reduction

From right to left

prefix minus, suffix minus

~

Bitwise non-/FETCH-complement operation

From right to left

Monocular

Logical Non-

From right to left

Monocular

“!” cannot be associated with "="

3

*

By

From left to right

Binocular

/

Except

From left to right

Binocular

Integer division: The integer part of the fetch, the fractional part removed, not rounded

%

Take surplus

From left to right

Binocular

4

+

Add

From left to right

Binocular

-

Reducing

From left to right

Binocular

5

< Span style= "color: #800000;" > << 

left shift operator

left-to-right

Binocular

&NBSP;

>>

Signed right shift operator

From left to right

Binocular

>>>

Unsigned Right Shift

From left to right

Binocular

6

<

Less than

From left to right

Binocular

Relational operator "greater than" description

<=

Less than or equal to

From left to right

Binocular

>

Greater than

From left to right

Binocular

>=

Greater than or equal to

From left to right

Binocular

instanceof

Determines whether an object belongs to a specified class

From left to right

Binocular

7

==

Equals

From left to right

Binocular

Description of the relational operator "= ="

!=

Not equal to

From left to right

Binocular

8

&

Bitwise-AND

From left to right

Binocular

9

|

bitwise OR

left-to-right

Binocular

&NBSP;

^

bitwise XOR

from left to right

Binocular

 

one

&&

Short circuit with

left-to-right

Binocular

&NBSP;

| |

short circuit or

left-to-right

Binocular

&NBSP;

?:

conditional operator

right-to-left

three mesh

 

14

=

Assignment operators

From right to left

Binocular

+=

Mixed assignment operators

-=

*=

/=

%=

&=

|=

^=

<<=

>>=

>>>=

Table from Blog: http://www.cnblogs.com/gw811/archive/2012/10/13/2722752.html

Java operator Precedence

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.