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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access