title: Why does using a default-valued Java Integer result in a NullPointerException?
body: <p>I am new to Java. I just read that class variables in Java have default value.</p>
  
  <p>I tried the following program and was expecting to get the output as <code>0</code>, which is the default value on an integer, but I get the <code>NullPointerException</code>.</p>
  
  <p>What am I missing?</p>
  
  <pre><code>class Test{
      static Integer iVar;
  
      public static void main(String...args) {
          System.out.println(iVar.intValue());
      }
  }
  </code></pre>