Program to demonstrate abstract class and abstract methods in VB.net.

Program to demonstrate abstract class and abstract methods in VB.net.

Ques :Write a program to demonstrate abstract class and abstract methods in VB.net.

Imports System.Console

Public MustInherit Class a1
Public Sub show()
WriteLine("Show fn A1")
End Sub
Public MustOverride Sub disp()
End Class

Class a2 : Inherits a1
Public Overrides Sub disp()
WriteLine("Disp of a2")
End Sub
End Class

Module Module1
Sub Main()
Dim obj As a2 = New a2()
obj.show()
obj.disp()

End Sub
End Module

Output screenshot :

Program to demonstrate abstract class and abstract methods in VB.net.

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>