title: Why i am getting NullPointerException when accessing a member of Array of objects?
body: <p>This is where i am getting error</p>
  
  <pre><code>Student[] student = new Student[10];
  
  System.out.println(" Test : " + student[2].RollNo);
  </code></pre>
  
  <p>But i do not get error when</p>
  
  <pre><code>Student student = new Student();
  
  System.out.println(" Test : " + student.RollNo);
  </code></pre>
  
  <p>Error only shows up when i am creating array of objects.</p>