One Class implements two Interfaces which have the same name method : Interface « Class « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Class » Interface 




One Class implements two Interfaces which have the same name method
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 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
1.Interface inherits interfaceInterface inherits interface
2.Class implements two interfaces
3.Implements an InterfaceImplements an Interface
4.Implement an InterfaceImplement an Interface
5.Define and use Interface AgeDefine and use Interface Age
6.Interface Inherits another InterfaceInterface Inherits another Interface
7.Define and use InterfaceDefine and use Interface
8.Implements Two InterfacesImplements Two Interfaces
9.Generic Class and InterfaceGeneric Class and Interface
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.