I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.
Printable View
I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.
There are two types of Inheritance. They are namely:
Single Inheritance
Multiple Inheritance
Single Inheritance:
This is one in which derived class has only one direct base class.
Multiple Inheritance:
This is one in which derived class has more than one direct base class.
hi
types of inheritance
single level inheritance eg ( class B extends Class A)
Multilevel inheritance eg( class C extends class B and class B extends class A)
multiple inheritance Class C inherits Class A features as well as Class B featues.This type of inheritance is not allowed in JAVA.
hop this helps u to some extent
bye:)
there are many tpes of inheritence:
single inheritence-one super and one sub class
multiple-many super and one sub class
multi level-the sub class of one level forms the super class of another level
hierarchical- one super and many sub classes
hybrid-multiple and multi level combined.
Thank you friends for your answers.I could get a detailed idea on types of inheritance available.
[QUOTE=scott;1857]I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.[/QUOTE]
there 5 types of inheritence
1.singleton inheritence
2.multilevel inheritence
3.hirarchical inheritence
4.hybrid inheritence
5.multiple inheritence
In C++ inheritance can be private or public.
Private inheritance [class A {...}; class B : private A {...};] means that sub-class will inherit only public methods of base class.
Public inheritance [class A {...}; class B : public A {...};] means that sub-class's methods can access protected fields of base class.
There are two types of inheritance used in modern programming languages. C# and other .NET languages use single inheritance. This means that a subclass may only inherit functionality from a single base class.
Multiple inheritance permits a subclass to have two or more superclasses. In this situation the derived class inherits functionality from several base classes. Multiple inheritance is not supported by C# or the .NET framework. However, this does not stop a class from providing many public interfaces as will be seen in a later article.
PLease let me know if i am wrong or missing something
[QUOTE=scott;1857]I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.[/QUOTE]
Basically there are two types of inheritances are there.
they are:
single and multiple..
But, actually we had 5 types of inheritances are there.
they are:
single inheritance.
multiple inheritance.
multi-level inheritance.
hybrid inheritance and
multi path inheritance.
inheritance is of 5 types
1.single inheritance:
only one baseclass,and one derived class access memberfunctions,datamembers from it. and derived class can't behave again base class.
2.multilevel inheritance:
eg: base class
l
derived1 class
l
derived2 class
l
derived3 class
.
.
again derived class acts as another base class
3.multiple inheritance:
there are two base classes and one derived class which is derived from both two base classes.
base1 class base2class
derived class
4.hirarchical inheritance:
in this one common base class and derived class and from those another derived classes.
5.hybrid inheritance:
it is a combination of any above inheritance types.
that is either multiple-multilevel
multiple-hirarchical
any other combination
[QUOTE=scott;1857]I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.[/QUOTE]
Inheritance are 3 types
1. Multilevel Inheritance
2. Multiple Inheritance
3. cyclic Inheritance
note : - cyclic Inheritance is never used and no programming language support it.
multilevel inheritance
There are 6 types of inheritance viz,
1.Single level inheritance
2.Multiple level inheritance
3.Multilevel inheritance
4.Hybrid inheritance
5.Heirarchial inheritance
6.Multipath inheritance
There are exect five types of Inhertience .
1). Single level Inhertience.
2). multilevel Inhertience.
3). hybrid Inhertience.
4).hierarchical Inhertience.
5).multipal Inhertience.
But multilevel or multipal can be consider the same.
Types of inheritance are 1.single inheritance 2.multiple inheritance 3.multipath inheritance 4.multi level inheritance 5.virtual path inheritance 6.hierarchical inheritance 7.hybrid inheritance
[QUOTE=scott;1857]I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.[/QUOTE]
they are single,multiple,hybrid and multilevel types
we can easily get what they mean through it
[QUOTE=scott;1857]I know basic concepts of Inheritance. But I want to know is there any types of inheritance? If so how many types are available and what are they. Can someone brief me on this.[/QUOTE]... plz roly as soon as possible
Thier are 4 type of inheritence ----
1.single level
2.multilevel
3.multiple (in java knn as Interface)
4.Heirarchical
5.Hybrid
C++ has the following inheritanceses single inheritance multiple inheritance multilevel inheritance hybrid inheritacnce,heirarchical inheritace in java has the following inheritances single ,multilevel ,hybrid, java does not support multiple inheritance, but overcomming the above problem using interface
Two types
(1) implementation
(2) interface
Differences in multiplicity and protection level have already been mentioned.