|
There are 4 classes. Why can only 3 be instantiated? A good answer might be:The parent class Card is an abstract class and therefore cannot be instantiated. | ||
Can't Instantiate an Abstract ClassThe program can't do the following:
Because Card is an abstract class, the compiler would say this is a syntax error. However, the following is OK:
It is OK to save a reference to a Valentine object in a reference variable of type Card because Valentine is-a Card. You can think of the reference variable card as being a card rack designed to hold any specific instance of a Card. | ||
QUESTION 11:Do you think it would be OK to do the following?
|