C# Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 13)
13.
Which of the following statements are correct about Inheritance in C#.NET?
  1. A derived class object contains all the base class data.
  2. Inheritance cannot suppress the base class functionality.
  3. A derived class may not be able to access all the base class data.
  4. Inheritance cannot extend the base class functionality.
  5. In inheritance chain construction of object happens from base towards derived.
1, 2, 4
2, 4, 5
1, 3, 5
2, 4
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Olsen said:   10 years ago
1 and 3 do not contradict infact both are true along with 5 since a base class inherits all data members. But it can't have access to private fields.

Bhavin said:   1 decade ago
Seems something incomplete in option one. Derived class can not access private data of base class so it is wrong to say all data.
(1)

Rakhi Kirti said:   1 decade ago
The above statement is trues as the derived class have access to all the data members except the private data members.

Aditya said:   1 decade ago
A derived class object contains all the base class data. It just does not have access to private members.

Shaila said:   1 decade ago
@Bhavin true it is right to say that 1 3 contradict each other.

Post your comments here:

Your comments will be displayed after verification.