public class Child : IFather, IMother
{
void IFather.Method()
{
Console.WriteLine("Father Interface Method");
}
void IMother.Method()
{
Console.WriteLine("Mother Interface Method");
}
public void Method()
{
Console.WriteLine("Child Class Method");
}
}
|
Public Class Child
Implements IFather
Implements IMother
Private Sub IFather_m() Implements IFather.m
Console.WriteLine("Father Interface Method")
End Sub
Private Sub IMother_m() Implements IMother.m
Console.WriteLine("Mother Interface Method")
End Sub
Public Sub Method()
Console.WriteLine("Child Class Method")
End Sub
End Class
|
class Program
{
static void Main()
{
IFather f = new Child();
f.Method();
IMother m = new Child();
m.Method();
Child c = new Child();
c.Method();
Console.ReadLine();
}
}
|
Class Program
Private Shared Sub Main()
Dim f As IFather = New Child()
f.Method()
Dim m As IMother = New Child()
m.Method()
Dim c As New Child()
c.Method()
Console.ReadLine()
End Sub
End Class
|