Tuesday, July 28, 2009

Anyone pls explain this?

I want to know about various types of Inheritance in C#


with its syntax

Anyone pls explain this?
Inheritance:





C# supports two types of Inheritance mechanisms


1) Implementation Inheritance


2) Interface Inheritance


What is Implementation Inheritance?





- When a class (type) is derived from another class(type) such that it inherits all the members of the base type it is Implementation Inheritance


What is Interface Inheritance?





- When a type (class or a struct) inherits only the signatures of the functions from another type it is Interface Inheritance.





In general Classes can be derived from another class, hence support Implementation inheritance. At the same time Classes can also be derived from one or more interfaces. Hence they support Interface inheritance. Structs can derive from one more interface, hence support Interface Inheritance. Structs cannot be derived from another class they are always derived from System.ValueType








i got this from the site below


http://www.exforsys.com/content/view/174...
Reply:single


multiple


multi level


hirarchy


hybrid





Its tooo hard 2 type the whol syntaxes of each one in this


single- its creating a new class from base class.


multiple- from base class 2 derived classes


multilevel- from one base class to a derived class and from the derived class ogain a derived class


hirarchy- from 2 base classes one derived class


hybrid- from 1 base class 2 derived and from those 2 derived classes again a derived class


No comments:

Post a Comment