title: How avoid multiple IF loops in Java
body: <p>What is the best way to avoid multiple <code>if</code> blocks which is used for <code>null</code> checks in Java?</p>
  
  <p>The following is my sample code. Which one is the most optimized way?</p>
  
  <pre><code>if (address!=null} {
      if (firstName!=null) {
          if (lastName!=null) {
  
          }
      }
  }
  </code></pre>