-1

what came first in priority between AND ,OR. and what is the difference between single (OR) and double (Or) like: x||y and x|y.

  • 1
    Does this answer your question? [What is the difference between & and && in Java?](https://stackoverflow.com/questions/5564410/what-is-the-difference-between-and-in-java). You can also take a look [here](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html) for information on operator precedence. – Henry Twist Oct 31 '21 at 09:11

1 Answers1

0

AND is first in priority then the OR comes.

and the difference between (||) and (|) for example:

{if(condition1 || condition2 || condition3)}

If condition1 is true, conditions 2 and 3 will NOT be checked.

{if(condition1 | condition2 | condition3)}

This will check conditions 2 and 3, even if 1 is already true.