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

前端 未结 5 1812
半阙折子戏
半阙折子戏 2020-12-11 15:29

I have this expression:

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

Which of these elements (&&, ||, ==<

5条回答
  •  隐瞒了意图╮
    2020-12-11 16:11

    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

提交回复
热议问题