Constructors and Destructors
Tags:
VB
, OO
, 2003
, Language
, Beginning
Constructors are the rough equivilent of the Initialize event in VB6 classes, but with the added ability to be overloaded. The is no true equivilent to the Terminate event in VB6 classes, which is deterministic ... in other words, in VB6 you know exactly when the object was being unloaded from memory. However, due to garbage collection in VB.NET, finalization in in-deterministic ... you don't REALLY know when an object is being unloaded from memory, therefore you must adopt new practices for object "clean-up". This video discusses constructors and the finalize method in classes, as well as a common convention to be used before setting a object reference to nothing.