Difference between OR operator || and | in Java?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7101992/why-do-we-usually-use-not-what-is-the-difference">Why do we usually use <code>||</code> not <code>|</code>, what is the difference?</a>  </p>
</blockquote>



<p>Can any one explain the difference between and usage of OR operator ( <code>||</code>  and <code>|</code> ) in java. thanks</p>

<p>e.g: </p>

<pre><code>if(a || b) {
// Do something.
}
</code></pre>

<p>and</p>

<pre><code>if(a | b) {
// Do something.
}
</code></pre>
