Inheritance definition with example
Definition: Acquiring the base class properties in the derived class.Example:
Class A
{
public void Add()
{
}
}
Class B:A
{
public void Mul()
{
public void
}
}
Main()
{
static void main(string args[])
{
B objB=new B();
objB.Add(); //here B class can get use the method of class A.
}
}
See more inheritance types
Single level inheritance |
Multi-level inheritance |
Multiple inheritance |
Hierarchical inheritance |
Hybrid Inheritance |
See more OOPS DOTNET Interview Questions
See more ASP.NET, C#.NET, SQL Server and more Interview Questions
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.