Skip to content
Advertisement

Tag: logical-operators

Evaluation order of Java operators && vs ||

I have this simple code block When I run this, the console is This result tell me that only a++ == 10 is evaluated. As I read from this https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html, operator && have higher priority than || and should be evaluated first. In this book OCA Java SE 8 Programmer I Certification Guide, at twist 2.4, a similar example give

Advertisement