Solved

If You Have the Following Class Definitions, Which of the Following

Question 39

Multiple Choice

If you have the following class definitions, which of the following is the proper way to construct an object of the derived class?
Class Pet
{
Public:
Pet) ;
Void printPet) ;
String getName) ;
Void setNamestring newName) ;
Private:
String name;
};
Class Dog:public Pet
{
Public:
Dog) ;
Void printPet) ;
Void setTypestring newType) ;
String getType) ;
Private:
String type;
};


A) Dog::Dog) :Pet) ,type"MUTT") {
}
B) Dog::Dog) {
Name="Rover";
}
C) Pet::Dog) :Pet) ,type"MUTT") {
}
D) Dog::Pet) :Pet) ,type"MUTT") {
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions