I have got confused due to what is true regarding the operator precedence in Java. I read in tutorials a long time ago that AND has a higher priority than OR, which is confi
That's because it is using the | operator instead of ||, which has a higher priority. Here's the table.
|
||
Use the || operator instead and it'll do what you think.