title: How to PROVE the precedence of '&&' and '||' by coding in Java?
body: <p>I know from somewhere that logical AND: <code>&amp;&amp;</code> has a higher precedence than logical OR: <code>||</code> in Java, but until now I haven't found any clue about how this precedence really acts. What would happen if I didn't know about the precedence of the two and what mistake would I make?
  I tried to write some code to PROVE the precedence of <code>&amp;&amp;</code> and <code>||</code> but failed, for example:</p>
  <pre><code>boolExp1 || boolExp2 &amp;&amp; boolExp3 || boolExp4
  </code></pre>
  <p>The code above produces the same results no matter the precedence of <code>&amp;&amp;</code> and <code>||</code>, that is,</p>
  <pre><code>false || false &amp;&amp; true || false
  </code></pre>
  <p>results in <code>false</code> no matter what the precedence is.</p>
  <p>I want a method or function that can PROVE the precedence of <code>&amp;&amp;</code> and <code>||</code>. It should produce different results depending on the precedence of <code>&amp;&amp;</code> and <code>||</code>. Is it possible?</p>