The Anatomy of a Class: Overview

Before we discuss each class member in detail, let's get an overview of the members we have available.

Syntax Box 12.1 expands the syntax shown in Figure 12.1 by including the total set of members we can include in the class definition. The first few lines displays the familiar class definition syntax consisting of the class keyword followed by the name of the class (identifier) and the set of curly braces that forms the class body where the class members reside. Further down, the class members have been divided into three broad categories—data members, function members, and nested types. The following provides a brief introduction to the members of each of these categories, which also have been listed in the ...

Get C# Primer Plus now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.