Difference between multi-level and multiple inheritance?
Answer Posted / muhammad asim
Multiple inheritance::::
Multiple inheritance refers to a feature in which a class can inherit
behaviors and features from more than one superclass. This contrasts
with single inheritance, where a class may inherit from only one
superclass.
Syntax:
Class derived: <access specifier> base_class_name1,
<access specifier> base_class_name2
____________________________________________________________
Multilevel Inheritance:::
When you define more than two levels of inheritance (in the form of a chain of
classes), it would be generally referred to as multi-level inheritance. In the
case of multi-level inheritance, all the members of all super classes would be
automatically available within the sub class.
Syntax:::
Class base_class_name1
{
// List of members
};
Class derived_base_name2 : <access specifier> base_class_name1
{
// List of members
};
Class derived : <access specifier> derived_base_name2
{
// List of members
Class A
Class B
Class C
• Base Class To Both classes B and C but it is
Direct Base Class to B and Indirect Base Class
To Class C.
• Direct Base Class To Class C and Derived
from Class A.
• Derived from Class B, But it also act as
An Indirect Derived Class of A
____________________________________________________________
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between list and arraylist c#?
Any problem found in vs.et
What is a generic method?
How do you declare a method in c#?
What are anonymous types in c#?
How do you prevent a method from being overridden in c#?
What is meant by clr?
What do u mean by delegation?
Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server
What are interfaces in c#?
What is the difference between the debug class and trace class? Documentation looks the same.
What is a property c#?
What are native methods?
What are logical operators in c#?
What is wrong with the sample program below?