title: Initialize each element of the array with Student objects
body: <pre><code>public class Student { 
      int marks; 
      String name; 
      char sex; 
      String email; 
  }
  Student[] s = new Student[10];
  
  public class StudentDemo {
      Student s[] = new Student[10];// array Student//
      Student s1  = new Student();//  Student Object//
      s1.setName("John"); //Eclipse says here there is a mistake an ask to delete John// 
      Student[0]=s1;
  }
  </code></pre>
  
  <p>I have created a Student class with name and other attributes. But now I want to initialize each element of the array with Student objects. Is this code right? Eclipse throws a lot of red dots.
  Help.</p>