title: printing to screen counter value of an array in system.out.print.ln
body: <p>I am trying to enter Strings into an array Input by user - using Scanner.
  I am prompting user for total amount of students and saving this in a variable to determine array length.
  Each loop I would like to ask the question "what is the name of student" (and their position in counter) ie student #1 student# 2 etc
  The below code seems to be working as is. </p>
  
  <pre><code>System.out.println("what is first name of student")
  </code></pre>
  
  <p>when I add to the end of this + counter+ I get an error message "illegal start of expression"</p>
  
  <p>Please help, and find entire code below. Thanks</p>
  
  <pre><code>public class Student
  {
      public static void main(String[]args)//Main method
      {
          Scanner input=new Scanner(System.in);
  
          int studentNumber;// declare a variable to store # students
  
          System.out.println( "Please enter the number of students.");
  
          noStudent=input.nextInt();//take in user input for number of racers
  
          while (noStudent&lt;2 || noStudent&gt;20)// validate users 
          {
              //while users input is invalid, alert user and prompt user for a valid number
              System.out.println("Invalid input please re-enter a number between 2 and 20.");
              noStudent=input.nextInt();
          }
  
          String[] nameArray = new String[noStudent];
  
          for(int counter = 0; counter&lt;nameArray.length; counter++)
          {
              System.out.println("please enter first name of student "  + i+);  
              nameArray[counter] = input.next();
          }
      }//end main
  }//end class
  </code></pre>