Class Usage in General

Usually, to benefit from the functionality provided by a class (or encapsulated in a class), we construct an object of that class. Then, we get a reference to the newly created object (instance of the class) and work with this object by invoking its methods or accessing its properties or fields. Finally, when we finish working with the object, we dispose it; that is, we free the memory that we allocated when constructing it. We examine an object's life cycle in a .NET application in the next section.

There are cases when we do not need to create an object in order to use certain classes. These classes define so-called static methods that provide general functionality and are not bound to the specific properties. You access ...

Get Programming PERL in the .NET Environment 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.