What goes in to the parentheses of studentList.addStudent()? : <p>So I have a <strong>GUI</strong> class with the <code>addStudent()</code> method that is meant to call the method: <code>addStudent(Student aNewStudentObj)</code> of the <strong>Manager</strong> class to then create an object of the <strong>Student</strong> class using the information inputted by the user. This object is then meant to be stored in the Linked List that is in the <strong>Manager</strong> class. </p>

<p>My question is, what goes in the parentheses of the <code>addStudent()</code> method that is located in the <strong>GUI</strong> class if anything is meant to go in there? </p>

<p>I have literally tried everything that I could think of and now I am at the point of losing my hair so all help possible would very much be appreciated. Please. </p>

<p>I believe all required code is below but if you need the full <strong>GUI</strong> class, let me know. I also have a <strong>Module</strong> class but I don't think that will be necessary for this question.</p>

<p><code>addStudent()</code> method from <strong>GUI</strong> class below</p>

<pre><code>public void addStudent() {

        Manager studentList = new Manager();
        studentList.addStudent();  &lt;-----------------  What goes in those brackets?
    }
</code></pre>

<p><strong>Student</strong> class below</p>

<pre><code>public class Student {

    private String firstName;
    private String surname;
    private String email;
    private int yearOfStudy;
    private int studentId;
    private Queue&lt;Module&gt; mods = new LinkedList&lt;&gt;();

    public String getFirstName() {
        return firstName;
    }

    public String getSurname() {
        return surname;
    }

    public String getEmail() {
        return email;
    }

    public int getYearOfStudy() {
        return yearOfStudy;
    }

    public int getStudentId() {
        return studentId;
    }

    public String print() {
        return "Student ID: " + studentId + "\n"
                + "First Name: " + firstName + "\n"
                + "Surname: " + surname + "\n"
                + "Email: " + email + "\n"
                + "Year of Study: " + yearOfStudy;
    }

    public void addModule(int id, String mCode, int mMark) {
        if (mods.size() == 4) {
            mods.remove();
        }

        Module module = new Module();
        mods.add(module);
    }

    //this method returns the module list of this student sorted by marks
    public String getModulesSortedByMarks(int id) {
        Object[] sortedMods;
        sortedMods = mods.toArray();

        Arrays.sort(sortedMods);

        String sortedModulesList = "";
        for (int i = 0; i &lt; sortedMods.length; i++) {
            sortedModulesList = "\n" + ((Module) sortedMods[i]).print();
        }
        return sortedModulesList;

    }
}
</code></pre>

<p><strong>Manager</strong> class below</p>

<pre><code>public class Manager {

    List&lt;Student&gt; studs = new LinkedList&lt;&gt;();

    public void addStudent(Student aNewStudentObj) {

        studs.add(aNewStudentObj);
    }

    public void displayStudent(int studentId) {

        System.out.println(studs.get(studentId));
    }

    public void displayMarks(int studentId) {

        Student marks = new Student();
        marks.getModulesSortedByMarks(studentId);
    }

    public void deleteStudent(int studentId) {

        studs.remove(studentId);
    }

    public void displayAll() {

        for (Student student : studs) {
            student.print();
            System.out.println();
        }
    }
}
</code></pre>
