|
Card c; Valentine v; Birthday b; Holiday h A good answer might be:
| ||||||||||||||||||||
Another Hierarchy
A parent reference variable can hold a reference to an object of one of its child types (or a reference to one of their child types, and so on.) However, the opposite directionparentReference = childReference can not be done, unless the parentReference actually refers to a child object (this is rare.)// don't do this childReference = parentReference Here are some variables: Look at the table and decide if each section of code is correct or not.Rodent rod; Rat rat; Mouse mou;
| ||||||||||||||||||||
QUESTION 15:There is still much more to learn about inheritance and polymorphism. Click Here after you have answered the question |