常用对照表-java 运算符优先级

上传人:mg****85 文档编号:45678399 上传时间:2018-06-18 格式:PDF 页数:5 大小:129.11KB
返回 下载 相关 举报
常用对照表-java 运算符优先级_第1页
第1页 / 共5页
常用对照表-java 运算符优先级_第2页
第2页 / 共5页
常用对照表-java 运算符优先级_第3页
第3页 / 共5页
常用对照表-java 运算符优先级_第4页
第4页 / 共5页
常用对照表-java 运算符优先级_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《常用对照表-java 运算符优先级》由会员分享,可在线阅读,更多相关《常用对照表-java 运算符优先级(5页珍藏版)》请在金锄头文库上搜索。

1、Java 运算符优先级运算符优先级postfixexpr+ expr-unary+expr -expr +expr -expr !multiplicative* / %additive+ -shift relational = instanceofequality= !=bitwise AND&bitwise exclusive ORbitwise inclusive OR|logical AND&logical OR|ternary? :assignment= += -= *= /= %= &= = |= = =C+运算符优先级PrecedenceOperatorDescriptionAss

2、ociativity1:Scope resolutionLeft-to-right2+ -Suffix/postfix increment and decrement()Function callArray subscripting.Element selection by referenceElement selection through pointer3+ -Prefix increment and decrementRight-to-left+ Unary plus and minus! Logical NOT and bitwise NOT(type)Type cast*Indire

3、ction (dereference)&Address-ofsizeofSize-ofnew, newDynamic memory allocationdelete, deleteDynamic memory deallocation4.* -*Pointer to memberLeft-to-right5* / %Multiplication, division, and remainder6+ Addition and subtraction7Bitwise left shift and right shift8 =For relational operators and respecti

4、vely9= !=For relational = and respectively10&Bitwise AND11Bitwise XOR (exclusive or)12|Bitwise OR (inclusive or)13&Logical AND14|Logical OR15?:Ternary conditionalRight-to-Left16=Direct assignment (provided by default for C+ classes)+= =Assignment by sum and difference*= /= %=Assignment by product, q

5、uotient, and remainder=Assignment by bitwise left shift and right shift&= = |=Assignment by bitwise AND, XOR, and OR17throwThrow operator (for exceptions)18,CommaLeft-to-rightC语言运算符优先级PrecedenceOperatorDescriptionAssociativity1+ -Suffix/postfix increment and decrementLeft-to-right()Function callArra

6、y subscripting.Structure and union member accessStructure and union member access through pointer(type)listCompound literal(C99)2+ -Prefix increment and decrementRight-to-left+ Unary plus and minus! Logical NOT and bitwise NOT(type)Type cast*Indirection (dereference)&Address-ofsizeofSize-of_AlignofA

7、lignment requirement(C11)3* / %Multiplication, division, and remainderLeft-to-right4+ Addition and subtraction5Bitwise left shift and right shift6 =For relational operators and respectively7= !=For relational = and respectively8&Bitwise AND9Bitwise XOR (exclusive or)10|Bitwise OR (inclusive or)11&Lo

8、gical AND12|Logical OR13?:Ternary conditionalRight-to-Left14=Simple assignment+= =Assignment by sum and difference*= /= %=Assignment by product, quotient, and remainder=Assignment by bitwise left shift and right shift&= = |=Assignment by bitwise AND, XOR, and OR15,CommaLeft-to-rightPHP运算符优先级结合方向运算符附

9、加信息非结合clone newclone 和 new左array()非结合+ -递增递减运算符非结合 - (int) (float) (string) (array) (object) (bool) 类型非结合instanceof类型右结合!逻辑操作符左* / %算术运算符左+ - .算术运算符 和 字符串运算符左位运算符非结合 = =赋值运算符左and逻辑运算符左xor逻辑运算符左or逻辑运算符左,多处用到这个表给出Python的运算符优先级(从低到高).从最低的优先级(最松散地结合)到最高的优先级(最紧密地结合)。这意味着在一个表达式中,Python会首先计算表中较下面的运算符,然后在计算列在表上部的运算符。Python 运算符优先级运算符描述lambdaLambda表达式or布尔“或”and布尔“与”not x布尔“非”in,not in成员测试is,is not同一性测试,=,!=,=比较|按位或按位异或&按位与移位+,-加法与减法*,/,%乘法、除法与取余+x,-x正负号x按位翻转*指数x.attribute属性参考xindex下标xindex:index寻址段f(arguments.)函数调用(experession,.)绑定或元组显示expression,.列表显示key:datum,.字典显示expression,.字符串转换

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号