recategorized by
2,555 views
1 votes
1 votes

Consider the following two statements:

  1. A publicly derived class is a subtype of its base class
  2. Inheritance provides for code resuse

Which of the following statements is correct?

  1. Both statements a and b are correct
  2. Neither of the statements a and b are correct
  3. Statement a is correct and b is incorrect
  4. Statement a is incorrect and b is correct
recategorized by

2 Answers

0 votes
0 votes

Ans is A both are true

obivously

  1. Inheritance provides for code resuse is straightforward 

for  •Public inheritance creates sub-types

–Inheritance only applies to user-defined classes (and structs)

A publicly derived class is-a subtype of its base class

–Known as “inheritance polymorphism”

Answer:

Related questions

1 votes
1 votes
1 answer
2
go_editor asked Aug 10, 2016
1,318 views
Match the following with reference to object oriented modelling :$\begin{array}{clcl} & \textbf{List-I} && \textbf{List-II} \\ \text{(a)} & \text{Polymorphism} & \text{(...