Working on a school assignment, I have an abstract class Person, an abstract class Student which extends Person, and a regular class CollegeStudent which extends student. CollegeStudent reads from a file and sets all the variables (including those which belong to the abstract superclasses). All this works fine.
However, we are supposed to have constructors in the abstract classes, which complicates things because those classes are specifically not supposed to be able to read input on their own. So now I have a situation in which I (presumably) am supposed to use constructors to set the data fields in their respective classes, but of course I need to read input first! The obvious problem here is that the superconstructor call must be the first thing in the constructor of CollegeStudent. This is the problem.
I can have everything run as is and then have another constructor method which can takes all the needed fields as parameters. But I don't see what the point of that is--why have the Driver create the CollegeStudentobject and then create it again (using the ariables from the first object) just for the sake of using the constructor?
Other than that I don't know how this could be done, and this option is odd to me--I don't see what the point is.
Thanks in advance...