title: How do I get rid of the error: illegal start of type in java?
body: <p>I am new to coding so bear with me. In my code, I am getting an illegal start of type error in my for loop (located in the student class). How can I fix this error? </p>
  
  <p>In my for loop, I want to have my array grades have 10 values (which is already defined), and these values will be random from 60 to 99. In my opinion, I think that part is correct, and throughout I have used correct methodology. So if anybody can see where I have gone wrong I would be very grateful :)</p>
  
  <pre><code>import javax.swing.*;
  
  public class StudentBase
  {
    public static void main(String[] args){
        StudentBase app = new StudentBase();
        app.go();
      }
  
      void go(){
          //this is the main routine
           JOptionPane.showMessageDialog(null, "Welcome!" + '\n');
  
           String n = JOptionPane.showInputDialog("Type in your name");
           JOptionPane.showMessageDialog(null, "Press ok if your name is" + " " +  n);
  
           String h = JOptionPane.showInputDialog("What is your height? (in meters: eg - 1.80)");
           JOptionPane.showMessageDialog(null, "Press ok if your height is" + " " + h + " " + "meters");
  
           JOptionPane.showMessageDialog(null, "Introduction to student class:" + " " + "Hello! My name is" + " " + n + " " + "and I am" + " " + h + " " + "meters tall.");
  
           String students[] = new String [20];
           JOptionPane.showMessageDialog(null, students);
      }
  }
  
  //this is where Student Class is defined
  
  class Student{
      //add variables, constructors and methods here
      String name = "";
      String height = "";
      int grades [] =new int [10];
  
    for(i = 0; i &lt; grades.length; i++)
      {
          grades[i] = rand(60,99);
      }
  
  
      public Student(String n, String h, int g[])
      {
          name = n;
          height = h;
          grades = g;
  
      }
  
  }
  </code></pre>