Multiple Inheritance using C# interfaces

Started by sukishan, Jul 11, 2009, 02:49 PM

Previous topic - Next topic

sukishan

Multiple Inheritance using C# interfaces:

   Next feature that obviously needs to be explained is multiple inheritance using c# interfaces. This can be done using child class that inherits from any number of c# interfaces. The inheritance can also happen with a combination of a C# .Net class and c# interfaces. Now let us see a small piece of code that demonstrate us multiple inheritance using only interfaces as parent data types.

class ClonableNode : INode,ICloneable


public object Clone()
{
return null;


// INode members
}


   The above example created a class ClonableNode. It implements all the functionality of INode interface in the same way as it was done in Node class. Also it realizes Clone method only one item of IClonable interface of .NET library.
A good beginning makes a good ending

dhoni

the inheritance program can be easily get from .net
this is easy and small program to get this