|
Interface is a handle or contract to access a COM object |
Explicit implementation and Multiple Inheritance, can be resolved
through inheritance |
|
Code Used:
using System;
//csc Interface_Inheritance2.cs
namespace ConsoleApplication1
{
interface Iparty
{ void eprint(); }
interface Ifood
{ void eprint(); }
public class RF :Ifood
{
public void eprint()
{ Console.WriteLine("Food is Ready for"); }
}
public class RP : Ifood
{
public void eprint()
{ Console.WriteLine("Birthday Party"); }
}
class Programm
{
static void Main(string[] args)
{
Console.WriteLine("Name conflict Resovled through Objects");
RF r1 = new RF(); RP r2 = new RP();
r1.eprint(); r2.eprint();
Console.ReadLine();
}
}
}
|
Below shows a masking effect of an inherted member by a local due to
name conflicts. |
|
Name conflicts are handled very efficiently with the objects. |
|
|