Logical Operator Precedence
<p>Through Java operator precedence table: </p>

<blockquote>
  <p>'|' Logical OR operator has higher precedence than '&amp;&amp;' logical AND operator.</p>
</blockquote>

<p>I checked above fact using following code </p>

<pre><code>int y = 5;
int x = 2;
if(  x++  &gt;  2  &amp;&amp;   ++y  &gt;  2  |  true    )
; //do nothing
System.out.println("x = " + x + " y = " + y);
</code></pre>

<p>but above line giving output as -</p>

<pre><code>x = 3 y = 5
</code></pre>

<p>showing that x++ is evaluating first.</p>

<p>Even I put parentheses at condition around | </p>

<pre><code>if(  x++  &gt;  2  &amp;&amp;   (++y  &gt;  2  |  true) )
;
</code></pre>

<p>But still I am getting the same output.</p>

<p>Why operator precedence not working in this case?</p>
