Program in VB.Net to build a class which implements an interface

Program in VB.Net to build a class which implements an interface

Que : Write a program in VB.Net to build a class which implements an interface

Ans:

Imports System.Console

 

Interface inf1

Sub show()

Sub disp()

End Interface

 

Class class1 : Implements inf1

 

Public Sub disp() Implements inf1.disp

WriteLine("Disp of class 1")

End Sub

 

Public Sub show() Implements inf1.show

WriteLine("show of Class 1")

End Sub

End Class

 

 

Module Module1

Sub Main()

Dim obj As class1 = New class1()

obj.disp()

obj.show()

 

End Sub

 

End Module

OUTPUT :

Write a program in VB.Net to build a class which implements an interface.

0 Like

Leave a Reply

Your email address will not be published. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>