|
Why is it best to use super? A good answer might be:You should not write the same code more than once. You might make a mistake the second time (for example: forgetting to initialize the member avail.) | ||
Instantiating MovieHere is an example program that makes use of the two classes:
(You can run this program by using NotePad and copying and pasting the class definitions from the previous pages.) When you run it, you will get the following output: Microcosmos, 90 min. available:true Jaws, 120 min. available:true The statement item2.show() calls the show() method of item2. This method was inherited without change from the class VideoTape. This is what it looks like:
It does not mention the new variables that have been added to objects of type Movie, so nothing new is printed out. | ||
QUESTION 11:Why not change show() in VideoTape to include the line
Click Here after you have answered the question
|