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

admin October 17, 2014 0 Comments

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 :

Abstract Methods and Classes - Programming Visual Basic ...

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

 

Leave a Reply