Chapter 6. Special Members

At this point, if you have been reading the book sequentially, you probably know the basics of writing classes—how to define a class, and how to add members such as fields and functions to a class. In the last chapter you also learned how to build one class by inheriting code from another class.

Aside from the basic members that you can add to a class, there are a few members that fall into the “special members” category. These are members that add functionality beyond what a basic member provides. For example, there are functions known as constructors that can trigger automatically when you create an instance of the class. There are also function definitions that enable the user of the class to pass a variable number ...

Get C# Web Development with ASP.NET: Visual QuickStart Guide 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.