
682 Chapter 14 • Upgrading Visual Basic Applications to .NET
object in Visual Basic .NET.When you set an object to Nothing, the object is
destroyed and the memory referenced by the object is freed. But there is more to
this than meets the eye.The Sub New procedure is a constructor that is called
whenever you create an object, and can contain code that does common initial-
ization tasks. It replaces the Class_Initialize method in Visual Basic 6.0.The Sub
New constructor cannot be explicitly invoked from anywhere in the program
except from another overloaded constructor in the same class or in a derived
class. Just as a constructor is called when an object ...