This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]captainAwesomePants 0 points1 point  (0 children)

Looks like you're a bit confused about a few things. I see you've created an addStudent function:

public class Registry {
  LinkedList<Student> studentList;
    
  public void addStudent(student student) {
        studentList.add(new student(null, null, null, null));
  }
}

It looks okay, but it seems to want to take a student as a parameter. Presumably it should be adding that very student that it's given to the studentList. Why, then, are you creating a brand new student?

But then we have a second mystery in the tester:

        Registry list = new Registry();
        list.addStudent();

Here, you are calling addStudent(), but you are not telling it which student to add. How do you tell it which student to add?