Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Types of Inheritance within the OOPS forums, part of the Software Development category; 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 ...
|
|||||||
|
|||
|
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.
|
| The Following 3 Users Say Thank You to scott For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Types of Inheritance
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. |
|
|||
|
Re: Types of Inheritance
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
__________________
:) NEVER SAY DIE. |
|
|||
|
Re: Types of Inheritance
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.
__________________
[B][B][I][COLOR="Blue"][FONT="Times New Roman"]Regards, Raju[/FONT][/COLOR][/I][/B][/B] |
| The Following User Says Thank You to raju1984 For This Useful Post: | ||
|
|||
|
Re: Types of Inheritance
Quote:
1.singleton inheritence 2.multilevel inheritence 3.hirarchical inheritence 4.hybrid inheritence 5.multiple inheritence |
|
|||
|
Re: Types of Inheritance
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. |
|
|||
|
Re: Types of Inheritance
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 |
| The Following User Says Thank You to peeyush_jain For This Useful Post: | ||
|
|||
|
Quote:
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 |
|
|||
|
Re: Types of Inheritance
Quote:
1. Multilevel Inheritance 2. Multiple Inheritance 3. cyclic Inheritance note : - cyclic Inheritance is never used and no programming language support it. |
|
|||
|
Re: Types of 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. |
|
|||
|
Re: Types of Inheritance
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
|
|
|||
|
Re: Types of Inheritance
Quote:
we can easily get what they mean through it |
|
|||
|
Re: Types of Inheritance
... plz roly as soon as possible
|
|
|||
|
Re: Types of Inheritance
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
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Types of Processing Times | blenda | Windows | 2 | 10-13-2008 10:26 AM |
| File Types in Linux | Bessie | Unix/Linux | 2 | 04-25-2007 06:19 AM |
| Triggers Types | scott | SQL | 1 | 07-30-2006 07:18 PM |
| Types of JDBC Deriver Managers | timmy | Java | 1 | 07-17-2006 05:12 PM |