title: Needing help to get the next line from the scanner and assign the value to the Array element at position i
body: <p>I'm really new to programming and I am having trouble trying to figure out how to write this line of code that I have to read the next line from the scanner and as assign the value to the candyArray at position i. I am also told that I need to incorporate the  readLine()  to advance the input cursor past the first line.</p>
  
  <pre><code>    public static void main(String[] args) throws FileNotFoundException {
      // File containing candy names
      File f = new File("candy.txt");
      Scanner sc = new Scanner(f);
  
      // Array of candy names
      String[] candyNames;
  
      // Number of names
      int numNames = sc.nextInt();
      // Move to the next line
      sc.nextLine();
  
      // Set the array size
      candyNames = new String[numNames];
  
      // Read each line and copy to array element
      for (int i = 0; i &lt; numNames; i++) {
      // Add the missing statement
      //The statement should get the next line from the scanner and assign
         //the value to the candyArray element at position i.
          candyNames[i].readLine(numNames);
       System.out.println("Adding " + candyNames[i]);
       }
  </code></pre>