title: How ro display array from constructor, using display method?
body: <p>I tried to use display method to print String array created in contstructor, but it doesn't work.... </p>
  
  <pre><code>class Person{
      public String givenName;
      public String lastName;
      public int age;
      public String gender;
      public String citizenship;
      public String[] students;
  
      public Person(){
          String[] students = {"Jae Choi", "Su Wu", "Harry Potter"};
          this.students = students; 
          this.givenName = "Jae";
          this.lastName = "Choi";
          this.age = 27;
          this.gender = "male";
          this.citizenship = "Korea";
      }
  }
  
  
  class Student extends Person{
      public double[] marks;
      public String [] diciplines;
      public int i;
  
      public Student(){
          double marks[] = {95.0, 50.5, 75.0};
          String diciplines[] = {"Supplementary class", "Consultation", "Extra homework"};
              for (i = 0; i &lt; marks.length; i++){
                  this.marks = marks;
                  System.out.println("Student name: " + this.students[i] + " / Mark: " + this.marks[i]);
              }
      }
  
  public void displayDisciplines(){
          String diciplines[] = {"Supplementary class", "Consultation", "Extra homework"};
          for (int i = 0; i &lt; diciplines.length; i++){
              System.out.println("Student name: " + this.students[i] + " / Dicipline: " + this.diciplines[i]);
          }
      }
  
  public class Main{
      public static void main(String[] args) {
          Student student = new Student();
          student.averageMarks();
          student.displayDisciplines();
  }
  </code></pre>
  
  <p>Exception in thread "main" java.lang.NullPointerException at Student.displayDisciplines(Student.java:41) at Main.main(Main.java:5)</p>
  
  <p>this is the result.</p>