Changes to Classes and Interfaces

VB6 used the Initialize and Terminate methods that are implemented as Class_Initialize and Class_Terminate in VB6. The VB6 Initialize method has been replaced with the constructor Sub New in Visual Basic .NET.

Object destruction is indeterminate in Visual Basic .NET. Objects are destroyed whenever the Garbage Collector (GC) gets around to it. By convention you can implement a Public Dispose subroutine that releases limited resources, like file handles and record sets, and you can overload a Protected Finalize destructor. Just keep in mind that object destruction does not necessarily happen immediately. (Read Chapter 7 for more information on constructors and destructors.)

Parameterized Constructors

Visual Basic ...

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.