title: Java: NULL in constructor
body: <p>Please I have this question which is a bit theoretical, but I would like to understand it.</p>
  
  <p>Why if I pass a null argument to a constructor do I get a <code>NullPointerException</code>?</p>
  
  <p>This is my example</p>
  
  <pre><code>new AttendeeDetail("Gus Goose","1151","15-01-2012",(Integer) null,null) 
  </code></pre>
  
  <p>This is the class:</p>
  
  <pre><code>public class AttendeeDetail {
  
      private String ticketholder_name;
      private String user_id;
      private String date_of_birth;
      private int tickets_purchased;
      private ArrayList&lt;Ticket&gt; tickets;
  
      public AttendeeDetail(String ticketholder_name, String user_id, 
          String date_of_birth, int tickets_purchased, ArrayList&lt;Ticket&gt; tickets) 
      {
          this.ticketholder_name=ticketholder_name;
          this.user_id=user_id;
          this.date_of_birth=date_of_birth;
          this.tickets_purchased=tickets_purchased;
          this.tickets=tickets;
      }
  }
  </code></pre>