One Class implements two Interfaces which have the same name method
Imports System
Imports System.Data
Imports System.Collections
public class MainClass
Shared Sub Main()
Dim c As New Class1()
Dim i2 As MySecondInterface
c.CommonFunction()
i2 = c
i2.CommonFunction()
End Sub
End Class
Interface MyFirstInterface
Sub UniqueFunction()
Sub CommonFunction()
End Interface
Interface MySecondInterface
Sub SecondUniqueFunction()
Sub CommonFunction()
End Interface
Public Class Class1
Implements MyFirstInterface
Implements MySecondInterface
Sub UniqueFunction() Implements MyFirstInterface.UniqueFunction
End Sub
Sub SecondUniqueFunction() Implements MySecondInterface.SecondUniqueFunction
End Sub
Sub CommonFunction() Implements MyFirstInterface.CommonFunction
Console.WriteLine("Common Function on first interface")
End Sub
Sub CommonFunctionSecondInterface() Implements MySecondInterface.CommonFunction
Console.WriteLine("Common function on second interface")
End Sub
End Class
Related examples in the same category