C# Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 1)
1.
Which of the following can be facilitated by the Inheritance mechanism?
  1. Use the existing functionality of base class.
  2. Overrride the existing functionality of base class.
  3. Implement new functionality in the derived class.
  4. Implement polymorphic behaviour.
  5. Implement containership.
1, 2, 3
3, 4
2, 4, 5
3, 5
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
13 comments Page 1 of 2.

Samntha said:   7 years ago
Derived class can implement the methods and properties in the base class.

Tadewos said:   7 years ago
In Inheritance, derived class used the properties and methods defined in the Base class.

Vaithi said:   8 years ago
Yes, It's like a using already existing property from the parent class, add new property by child class which overrides the property too.

Mahesh.Pola said:   9 years ago
In Inheritance derived class used the properties and methods defined in the Base class.

Jana said:   10 years ago
Inheritance means you can implement the properties and methods of parent(Base) class into Child (derived) class.

And you can implement new functionality in child(derived) class as you want.

Nicholas Mahbouby said:   1 decade ago
Rahu: "It doesn't implement polymorphism. It just provides a way to implement polymorphism between methods".

The question says:

"Which of the following can be facilitated by the Inheritance mechanism?".

"4. Implement polymorphic behavior"

Facilitate means to assist, make easier or less difficult. Inheritance does assist the implementation of polymorphic behavior.

In the below example, animal could be an Elephant, a Lion or anything that inherits from the base class class Animal. All inherit the Eat method and thus can be used Polymorphically through the base class.

foreach(Animal animal in zoo)
{
animal.Eat(food);

...
}

Chandra Shekhar said:   1 decade ago
Polymorphism is a concept that tells us how to change the behavior of a method not a pre defined method or keyword.

Md. Afroz Alam said:   1 decade ago
Because in inheritance, a derived class inherit the feature of base class and functionality also there is no concept of polymorphism.

Ravi yadav said:   1 decade ago
We can also implement polymorphism(Methodoverriding and methodhidding) behavior.

Rahul said:   1 decade ago
It doesn't implement polymorphism. It just provides a way to implement polymorphism between methods.


Post your comments here:

Your comments will be displayed after verification.