欢迎来到天天文库
浏览记录
ID:38244090
大小:129.11 KB
页数:5页
时间:2019-05-31
《常用对照表-Java 运算符优先级》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Java运算符优先级运算符优先级postfixexpr++expr--unary++expr--expr+expr-expr~!multiplicative*/%additive+-shift<<>>>>>relational<><=>=instanceofequality==!=bitwiseAND&bitwiseexclusiveOR^bitwiseinclusiveOR
2、logicalAND&&logicalOR
3、
4、ternary?:assignment=+=-=*=/=%=&=^=
5、=<<=
6、>>=>>>=C++运算符优先级PrecedenceOperatorDescriptionAssociativity1::ScoperesolutionLeft-to-right2++--Suffix/postfixincrementanddecrement()Functioncall[]Arraysubscripting.Elementselectionbyreference−>Elementselectionthroughpointer3++--Prefixincrementanddecreme
7、ntRight-to-left+−Unaryplusandminus!~LogicalNOTandbitwiseNOT(type)Typecast*Indirection(dereference)&Address-ofsizeofSize-ofnew,new[]Dynamicmemoryallocationdelete,delete[]Dynamicmemorydeallocation4.*->*PointertomemberLeft-to-right5*/%Multiplication,divis
8、ion,andremainder6+−Additionandsubtraction7<<>>Bitwiseleftshiftandrightshift8<<=Forrelationaloperators>=Forrelationaloperators>and≥respectively9==!=Forrelational=and≠respectively10&BitwiseAND11^BitwiseXOR(exclusiveor)12
9、BitwiseOR(inclu
10、siveor)13&&LogicalAND14
11、
12、LogicalOR15?:TernaryconditionalRight-to-Left16=Directassignment(providedbydefaultforC++classes)+=−=Assignmentbysumanddifference*=/=%=Assignmentbyproduct,quotient,andremainder<<=>>=Assignmentbybitwiseleftshiftandrightshift&=^=
13、=
14、AssignmentbybitwiseAND,XOR,andOR17throwThrowoperator(forexceptions)18,CommaLeft-to-rightC语言运算符优先级PrecedenceOperatorDescriptionAssociativity1++--Suffix/postfixincrementanddecrementLeft-to-right()Functioncall[]Arraysubscripting.Structureandunionmemberacc
15、ess−>Structureandunionmemberaccessthroughpointer(type){list}Compoundliteral(C99)2++--PrefixincrementanddecrementRight-to-left+−Unaryplusandminus!~LogicalNOTandbitwiseNOT(type)Typecast*Indirection(dereference)&Address-ofsizeofSize-of_AlignofAlignmentreq
16、uirement(C11)3*/%Multiplication,division,andremainderLeft-to-right4+−Additionandsubtraction5<<>>Bitwiseleftshiftandrightshift6<<=Forrelationaloperators>=Forrelationaloperators>and≥respectively7==!=Forrelational=and≠res
此文档下载收益归作者所有