Question: The Pet base class defines a functionvoid set _ name ( string new _ name ) . The Cat class inherits from the Pet base
The Pet base class defines a functionvoid setnamestring newname The Cat class inherits from the Pet base class, but does not define the setname function.
Which one of the following is correct?
Question options:
The Cat class will not compile because it does not define the setname function.
The setname function cannot be called on Cat objects.
The Cat class overrides the setname function.
The Cat class inherits the setname function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
