Class Base
Public Sub New()
Console.WriteLine("The Base Class Constructor is Running")
End Sub
Protected Overrides Sub Finalize()
Console.WriteLine("The Base Class Destructor is Running")
MyBase.Finalize()
End Sub
End Class
Class Derived
Inherits Base
Public Sub New()
Console.WriteLine("The Derived Class Constructor is Running")
End Sub
Protected Overrides Sub Finalize()
Console.WriteLine("The Derived Class Destructor is Running")
MyBase.Finalize()
End Sub
End Class
Module Module1
Sub Main()
Dim Sample As New Derived()
End Sub
End Module
The Base Class Constructor is Running
The Derived Class Constructor is Running
The Derived Class Destructor is Running
The Base Class Destructor is Running