Consider the following two statements : (1) A publicly derived is a subtype of base class
Consider the following two statements :
(1) A publicly derived is a subtype of base class
(2) Inheritance provides for code ruse
Which one of the following statements is correct?
Show answerHide answer
Correct answer: (A) Both the statements (1) and (2) are correct
Explanation
Inheritance provides for code reuse, and public inheritance creates a subtype: a publicly derived class is a subtype of its base class. Both statements are correct.