According to your question,
if you use "|" operator like "if(x == 1 | x==2)" , both expressions are evaluated and if there is at least one TRUE value then run the body of the if block
if you use "||" operator like "if(x == 1 || x==2)", first expression is evaluated and if it is return TRUE then not going to evaluate second expression and run the body of the if block
if you use "&" operator like "if(x == 1 & x==2)" , both expressions are evaluated and if both expressions are return TRUE value then run the body of the if block
if you use "&&" operator like "if(x == 1 && x==2)", first expression is evaluated and if it is return FALSE then not going to evaluate second expression and DO NOT run the body of the if block
Additionally, "||" and "&&" can be used to save the time of operations of your application