Given the following simplified classes,
Class Pet
{
Public:
Virtual void print) ;
String name;
Private:
};
Class Dog: public Pet
{
Public:
Void print) ;
String breed;
};
Dog vDog;
Pet vPet;
VDog.name="rover";
VDog.breed = "Collie";
Which of the following statements are not legal?
A) vPet=vDog; cout << vDog.name;
B) vPet=vDog; cout << vDog.breed;
C) vPet=vDog; cout << vPet.name;
D) vPet=vDog; cout << vPet.breed;
Correct Answer:
Verified
Q43: If a base class has a non-virtual
Q44: If a derived class Class2) has redefined
Q45: Given the following classes and code, what
Q46: Given the following classes and code, what
Q47: Given a class A that derives from
Q48: Which of the following would correctly call
Q49: Which of the following should be virtual
Q50: In order to tell the compiler to
Q51: You should make a function a virtual
Q52: Polymorphism refers to
A) the ability to assign
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents