title: Java Strange behavior checking loop-conditions
body: <p>I have this:</p>
  
  <pre><code>while(victim.getHealth() &gt; 1 &amp;&amp; !victim.getName().equals(this.getName())) {
      victim.hurt();
  }
  </code></pre>
  
  <p>Now I noticed that in special occasions victim.getName() will return null (this is wanted behavior). But when that's the case I am expecting a NullPointerException to occur because we are basically calling null.equals(this.getName()) for the second condition.</p>
  
  <p>However this doesn't happen. If I switch the order of the loop-conditions, e.g.</p>
  
  <pre><code>while(!victim.getName().equals(this.getName()) &amp;&amp; victim.getHealth() &gt; 1) {
      victim.hurt();
  }
  </code></pre>
  
  <p>The NullPointerException will be thrown when getName() returns null.</p>
  
  <p>Also: If this was || condition and not &amp;&amp;, in java the programm will stop checking for true condition once it found one right?</p>