Which has more priority: || or && or ==

妖精的绣舞 提交于 2019-12-01 15:27:48

First ==, then &&, then ||.

Your expression will be evaluated as y[i] = (((z[i] == a) && b) || c).

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html

Alex

The priority list:

  1. ==
  2. &&
  3. ||

This would be :

y[i] = ((( (z[i]) == a )&& b) || c)

ref: http://introcs.cs.princeton.edu/java/11precedence/

The actual expression is evaluated as

y[i] = ( ((z[i] == a) && b) || c )

You probably want to look here for more info on operator precedence. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html

Here's the full list of ALL OPERATORS:

Full list of operators in Java

Got it from "Java ist auch eine Insel" = "Java is also an island"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!