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 set_name(string new_name). The Cat class inherits from the Pet base class, but does not define the set_name function.
Which one of the following is correct?
Question 11 options:
The Cat class will not compile because it does not define the set_name function.
The set_name function cannot be called on Cat objects.
The Cat class overrides the set_name function.
The Cat class inherits the set_name function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!