Discussion :: Inheritance - General Questions (Q.No.1)
|Nasreen Khan said: (Aug 25, 2011)|
|It is correct as inheritance is the mechanism of deriving a new class from the base class, thus we can excess the functionality of base class in derived class.|
|P.Vijayan said: (Sep 17, 2011)|
|Inherit means getting the property off.
Base class -> derived class.
Derived class has the features of base class and as its own.
|Abhishek said: (Jan 11, 2012)|
|Why is this "Implement polymorphic behaviour" is not included?|
|Rahul said: (Feb 2, 2012)|
|It doesn't implement polymorphism. It just provides a way to implement polymorphism between methods.|
|Ravi Yadav said: (Mar 20, 2012)|
|We can also implement polymorphism(Methodoverriding and methodhidding) behavior.|
|Md. Afroz Alam said: (Aug 1, 2012)|
|Because in inheritance, a derived class inherit the feature of base class and functionality also there is no concept of polymorphism.|
|Chandra Shekhar said: (Aug 30, 2013)|
|Polymorphism is a concept that tells us how to change the behavior of a method not a pre defined method or keyword.|
|Nicholas Mahbouby said: (May 6, 2014)|
|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)
|Jana said: (Aug 13, 2014)|
|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.
|Mahesh.Pola said: (Dec 18, 2014)|
|In Inheritance derived class used the properties and methods defined in the Base class.|
|Vaithi said: (Oct 27, 2016)|
|Yes, It's like a using already existing property from the parent class, add new property by child class which overrides the property too.|
|Tadewos said: (Jun 9, 2017)|
|In Inheritance, derived class used the properties and methods defined in the Base class.|
|Samntha said: (Oct 6, 2017)|
|Derived class can implement the methods and properties in the base class.|
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.