title: && (AND) and || (OR) in IF statements
body: <p>I have the following code:  </p>
  
  <pre><code>if(!partialHits.get(req_nr).containsKey(z) || partialHits.get(req_nr).get(z) &lt; tmpmap.get(z)){  
      partialHits.get(z).put(z, tmpmap.get(z));  
  }
  </code></pre>
  
  <p>where <code>partialHits</code> is a HashMap. <br><strong>What will happen if the first statement is true?</strong> <strong>Will Java still check the second statement?</strong> Because in order the first statement to be true, the HashMap should not contain the given key, so if the second statement is checked, I will get <code>NullPointerException</code>.<br>
  So in simple words, if we have the following code  </p>
  
  <pre><code>if(a &amp;&amp; b)  
  if(a || b)
  </code></pre>
  
  <p>would Java check <code>b</code> if <code>a</code> is false in the first case and if <code>a</code> is true in the second case?</p>