there I have a question. I am trying hard to do this without asking but after a couple of hours of searching and trying, I cannot seem to make it work. This is for an assignement. I just need guidance.
I have to create the following objects
Student(String name, double GPA)
Classroom (int maxClassSize)
The classroom object initializes an arrray where I would store the Student objects.
However, the array in Classroom() is declared as private (private Student students[]) so I am adding students using a public method
public boolean add(Student aStudent) *do not worry about the boolean type
I can also return the value of an array using a get method
public Student getStudent(int position)
Those methods are set in the assignment.
My question is, when I try to output the objects in the array (again, this is required for the assignment). I get the reference, ie Student@23e45e23 instead of the name and GPA of each object.
I cannot use toString.
Any ideas?