title: array variable might not have been initialized error
body: <p>I created class Supervisor which contains the constructor and a toString method. However when I try to print an Index of the array an error occur,"Variable svArray might not have been initialized.
  What can I do to solve this ? </p>
  
  <pre><code>Supervisor[] svArray;
  if (mainChoice == 3){
          String ID, name, department, resarch;
          System.out.println("Enter How Many Supervisor you want to enter : ");
          svNumber = input.nextInt();
          svArray = new Supervisor[svNumber];
          for (int i = 0; i &lt; svNumber; i++) {
              System.out.println("---Enter Supervisor " + (i + 1) + " Of " + svNumber + " ---");
              System.out.println("Enter staff ID : ");
              ID = input.next();
              System.out.println("Enter name : ");
              name = input.next();
              System.out.println("Enter department : ");
              department = input.next();
              svArray[i]=new Supervisor(ID, name, department);\
          }
  
  
      }
  System.out.print(svArray[1].toString)
  //Error, variable svArray might not have been initialized
  </code></pre>