Posted by: Sourav | August 20, 2016

Interface and multiple Inheritance example in VB,Visual Basic Teacher Sourav

Option Strict On
Option Explicit On
Imports System
Interface Iparentcustomer
Sub Iparentcustomer()
End Interface
Interface Icustomer1
Inherits Iparentcustomer
Sub Icustomer1()
End Interface
Interface Icustomer2
Inherits Iparentcustomer
Sub Icustomer2()
End Interface
Class intfclass
Implements Icustomer1, Icustomer2

Sub Icustomer1() Implements Icustomer1.Icustomer1
Console.WriteLine(“Hello I am interface Icustomer1”)

End Sub
Sub Icustomer2() Implements Icustomer2.Icustomer2
Console.WriteLine(“Hello I am interface Icustomer2”)

End Sub
Sub Iparentcustomer() Implements Icustomer1.Iparentcustomer
Console.WriteLine(“Hello I am interface Iparentcustomer of Icustomer1”)

End Sub
End Class

Module Module1

Sub Main()
‘Dim intf1 As intfclass = New intfclass
‘ Dim intfref As Iparentcustomer = New intfclass
Dim intfref As Icustomer1 = New intfclass

‘ Dim intfref As Icustomer2 = New intfclass


End Sub

End Module


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: