A good answer might be:Jaws, 120 min. available: true | |||||||||||||||
Using InheritanceThe VideoTape class has basic information in it, and would be OK for documentaries and instructional tapes. But movies need more information. Let us make a class that is similar to VideoTape, but has the name of the director and a rating.
The class Movie is a subclass of VideoTape. An object of type Movie has the following members in it:
Both classes are defined: the VideoTape class can be used to construct objects of that type, and now the Movie class can be used to construct objects of the Movie type. | |||||||||||||||
QUESTION 8:Are both variables and methods inherited? Click Here after you have answered the question |