Page 879 - AP Computer Science A, 7th edition
P. 879

students are either graduates or undergraduates. Having the Student class abstract guarantees that you won’t create an instance of a Student (who is neither a graduate nor an undergraduate). Choice E has a major design flaw: making Graduate an abstract class means that you can’t create any instances of Graduate objects. Disaster! If the keyword abstract is removed from choice E, it becomes a fine design, as good as that in choice B. Once Student has implemented all the common PersonalInformation methods, these are inherited by each of the subclasses.


































































































   877   878   879   880   881