Ask Question
18 February, 02:12

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 ();

0
Answers (1)
  1. 18 February, 03:21
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Valentine, Holiday, and Birthday inherit from the class Card. In order for the following code to be correct, what type must the reference ...” in 📗 World Languages if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers