Valentine, Holiday, and Birthday inherit from the class Card. In order for the following code to be correct, what type must the reference variable card be? card = new Valentine( "A", 14 ) ; card.greeting(); card = new Holiday( "B" ) ; card.greeting(); card = new Birthday( "C", 12 ) ; card.greeting();
1 answer:
Answer:The variable card must be of type Card
Explanation:The reference has to be of the same type of the class. In this case, there are many diferent classes and the common one is Card, as all inherit from it.
You might be interested in
Swift means quit or fast rushing means dash or in a hurry
Answer:
MrBeast
Explanation:
Yes Chicken Has more Protein Than Carrots
Answer:
??????????
??????????
Explanation:
?????????
Answer:
what the heck is all that
Explanation:
it looks like scipple to me sorry is it an other lang