Override toString() to display arraylist

I'm looking for a 'point' in the right direction. I am working on some homework for school and I have 4 classes.

The first class has the 'input' coded directly in it. It sets the variable values and then adds them to parallel arraylists.

The other class I am trying to use is being insatiate by the first class. I have been instructed to override the toString() and have it display all the information about the variables. I was also told that it is not to have any parameters. I can get it to work the way I have it but am having problems getting it to work according to the instructions.

Any advice would be appreciated. I've included the methods I'm referring to.

This is in the first class

publicvoid display()

{

int x = 0;

for (x = 0; x < studentIds.size(); x++)

{

System.out.println();

System.out.println(student1.toString());

System.out.println("Student ID: " + studentIds.get(x));

System.out.println("Name: " + studentNames.get(x));

System.out.println("School: " + studentSchools.get(x));

System.out.println("Extracurricular Activities: " + studentActivities.get(x));

System.out.println("Homeroom Teacher: " + studentHomeroomTeachers.get(x));

System.out.println("Show And Tell Item: " + studentShowAndTellItems.get(x));

}

}

This is in the second class

public String toString()

{

return"Student Grade: Kindergarten";

}

[2018 byte] By [easchmidta] at [2007-11-27 1:33:04]
# 1

public String toString() {

StringBuffer buffer = new StringBuffer();

// append all your info to the buffer

return buffer.toString();

}

floundera at 2007-7-12 0:38:31 > top of Java-index,Java Essentials,New To Java...
# 2
Thank you very much
easchmidta at 2007-7-12 0:38:31 > top of Java-index,Java Essentials,New To Java...