title: Trouble reading data and store in a object type instance variable
body: <p>I have created a following instance variable in Student Class:</p>
  
  <pre><code>private String name;
  private char gender;     // 'M' / 'F'
  private Date birthday;
  private Preference pref;
  private boolean matched;
  </code></pre>
  
  <p>for Preference class I created</p>
  
  <p><code>private int quietTime; // scale of 1-10
   private int music;     // 1 - 10
   private int reading;   // 1 - 10
   private int chatting;  // 1 - 10
  </code>
  for Date class I created</p>
  
  <p><code>
   private int year;  // between 1900 to 3000
   private int month; // between 1 to 12, 1 is jan;
   private int day;   // between 1- 31 assume feb max is 28 days!
  </code></p>
  
  <p>The trouble is my main method I try to import the following libraries</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.File;
  </code></pre>
  
  <p>and I want to read the txt file and store data on each one to the Student instance variables, below is my code I tried but I received the error about 
  " student cannot be resolved to a variable "
  and for example below is one of the line from the text file: </p>
  
  <p><code>Abhay  F   1-5-1994    0   0   0   0 // seperate by tab and '-'</code></p>
  
  <p>My code for match class - the main method class:</p>
  
  <pre><code>`
    Student[] students = new Student[100];
    int bestScore = 0;
    String readInfo = "";
  
    Scanner inFile = new Scanner(new File("Students.txt")).useDelimiter("\t-");
  
    for (int i = 0; i &lt; 100; i++) {
        readInfo = inFile.next();
        student[i] = readInfo;
    }
    inFile.close();
   }
  }
  
  while(1) {
    r.nextBoolean();
    if (!nextBoolean())
    {
      return true;
    }
  
  `
  </code></pre>
  
  <p>I just start to learn java for ten days, I am completely a newbie, May someone help me with how to fix the error, i am really appercate it!! </p>