program to demonstrate concept of abstract and
not inheritable class.
-----------------------------------------code---------------------------------------------------------
End Module
-----------------------------------------output----------------------------------------------------
-----------------------------------------code---------------------------------------------------------
Imports
System.Console
Module Module1
Public MustInherit Class
abstractclass
Public MustOverride Function
add() As Integer
Public MustOverride Function
mul() As Integer
End Class
Public Class abstractone
Inherits
abstractclass
Dim i As Integer = 20
Dim j As Integer = 30
Public Overrides Function
add() As Integer
Return
i + j
End Function
Public Overrides Function
mul() As Integer
Return
i * j
End Function
End Class
Sub Main()
Dim a As New abstractone
WriteLine("sum
is:" & a.add())
WriteLine("multiplication
is:" & a.mul())
ReadKey()
End Sub
-----------------------------------------output----------------------------------------------------
codestrew |
No comments:
Post a Comment