Module Module1
Class BaseClass
Public Name As String
Public Amount As Integer
Public Message As String
Public Sub New(ByVal Name As String, ByVal Amount As Integer, ByVal Message As String)
Me.Name = Name
Me.Amount = Amount
Me.Message = Message
End Sub
Public Sub ShowBaseMembers()
Console.WriteLine("Name: " & Name)
Console.WriteLine("Amount: " & Amount)
Console.WriteLine("Message: " & Message)
End Sub
End Class
Class DerivedClass
Inherits BaseClass
Public Amount As Double
Public Shadows Message As String
Public Sub ShowDerivedMembers()
Console.WriteLine("Name: " & Name)
Console.WriteLine("Amount: " & Amount)
Console.WriteLine("Message: " & Message)
End Sub
Public Sub New(ByVal Name As String, ByVal Amount As Integer, ByVal Message As String)
MyBase.New(Name, Amount, Message)
End Sub
End Class
Sub Main()
End Sub
End Module
|