Possible Duplicates:
A clear, layman's explanation of the difference between | and || in c# ?
What's the difference between | and || in Java?
what is the difference between the operator | and the operator || ??
and also what is the difference between & and && ??
thanks…
The main difference is that in an expression
a && b,bwill not be evaluated ifais false, while ina & bbothaandbwill be evaluated no matter what. One can say that&&“short-circuits” the evaluation.Similarly for
a || b:bwill not be evaluated ifais true, while ina | bbothaandbwill be evaluated no matter what.