posted 19 years ago
Based on your comment,
// create an array of 10 student objects from class Student...
your array declaration would look like
Student[] students = new Student[10];
Note that you want this outside your for loop, not inside; you want to create the array, then visit each element, right?
Now, this just gives you an array of 10 Student variables; the variables are all null. If you need objects, then you need to create those too; for example, inside your for loop, at the top, you might have
students[i] = new Student();
this would fill each element of the array with a Student object as you visited it.