title: Null Pointer Exception in creating an instance
body: <p>I have an exception and I don't know how to solve it.</p>
  
  <pre><code>Person a = new Person();
  Scanner in = new Scanner(System.in);
  System.out.println("Please type name: ");
  String name = in.nextLine();
  </code></pre>
  
  <p>It says there's an exception in the first line.
  The following code is the default constructor.</p>
  
  <pre><code>Person(){
           this.name = "No_Name";
           this.surname = "No_Surname";
           this.number = "No_Number";
           this.personalCode = "No_personalCode";
           this.dateOfBirth.set(Calendar.DAY_OF_MONTH, 1);
           this.dateOfBirth.set(Calendar.MONTH, Calendar.JANUARY);
           this.dateOfBirth.set(Calendar.YEAR, 1900);
       }
  </code></pre>
  
  <p>Class person full code:</p>
  
  <pre><code>import java.util.Calendar;
  public class Person {
       String name;
       String surname;
       private String number;
       private String personalCode;
       private Calendar dateOfBirth;
  
  
  
       Person(){
           this.name = "No_Name";
           this.surname = "No_Surname";
           this.number = "No_Number";
           this.personalCode = "No_personalCode";
           this.dateOfBirth.set(Calendar.DAY_OF_MONTH, 1);
           this.dateOfBirth.set(Calendar.MONTH, Calendar.JANUARY);
           this.dateOfBirth.set(Calendar.YEAR, 1900);
       }
       Person(String name,String surname,String number,String personalCode,Calendar dateOfBirth){
           this.name = name;
           this.surname = surname;
           this.number = number;
           this.personalCode = personalCode;
           this.dateOfBirth = (Calendar) dateOfBirth.clone();
  
       }
  
       Person setName(Person a, String name) {
           a.name = name;
           return a;
       }
       Person setSurname(Person a, String surname) {
           a.surname = surname;
           return a;
       }
       Person setNumber(Person a, String number) {
           a.number = number;
           return a;
       }
      Person setpersonalCode(Person a, String personalCode) {
          a.personalCode = personalCode;
          return a;
      }
  
      String getName(Person a) {
          return a.name;
      }
      String getSurname(Person a) {
          return a.surname;
      }
      String getNumber(Person a) {
          return a.number;
      }
      String getPersonalCode(Person a) {
          return a.personalCode;
      }
      Calendar getDateOfBirth(Person a) {
          return a.dateOfBirth;
      }
  }
  </code></pre>