Java Assignments That Make No Sense, Part 34
I have a Java assignment to pass up tomorrow. The class has to do with the basics, like data structures, and references. Now, the question is based entirely around a linked list, which you’re expected to build from scratch.
One problem though — the question cannot be solved by any means I know. Lets go through it together. First, you need to create a class called Student. This class contains information like the student’s name, id and so forth. Next, create a class called StudentNode, which contains an instance of Student called data, and another called nextStudent. data will contain the actual student information, and nextStudent will function as a pointer of sorts, thereby allowing advancement to the next item in the list.
Or will it? If nextStudent points at the next Student and Student doesn’t contain any reference to the next item in the list… how does one advance beyond the first item in the list? I don’t know. Do you?
Update: Just realised something. If I interpret their incredibly phrased document in just the right way, I can include a StudentNode instead of a Student in the StudentNode class…