title: Can the java-compiler eliminate dead-code from the following scenarios?
body: <p>(Question #0 : Does the java compiler eliminate dead-code by default?)</p>
  
  <p>Question #1: Suppose I have the following piece of code (which is artificially generated, so I don't have much control over), would the compiler be able to eliminate the dead-code for me?</p>
  
  <pre><code>    static void foo(final Object o)
      {
          if (o == null) {
              // do something
          }
          else {
              // do something
  
              if (o == null) { // this condition is never gonna be true
                  // do something
              }
              else {
                  // do something
              }
          }
      }
  </code></pre>