Abstract class in vb.net

Posted by Satyapriyanayak under VB.NET category on | Points: 40 | Views : 885
Abstract class:-It is an incomplete class whose object cannot be created. It contains the skeleton of the method which is implemented by the derived class. The abstract class is prefixed by the keyword MustInherit.The methods with in the class are prefixed by MustOverride keyword. The derived class procedure which implements the abstract class is prefixed by Overrides keyword. 

Public Class Form1
Dim a As New rajiv1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
Public MustInherit Class rajiv
Public MustOverride Sub sagar(ByVal s As String)
End Class

Public Class rajiv1
Inherits rajiv
Public Overrides Sub sagar(ByVal s As String)
MsgBox("Hello:" & s)
End Sub
End Class

Comments or Responses

Login to post response