Solved

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

Question 34

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents