124 ◾ Software Essentials
instantiated from this class denition will have its own copy of these data
elds. One static integer tracks the number of objects instantiated from
the class. If a data member is dened as static, one copy is allocated on the
class level; all objects share that copy. (Static data members are initialized
in the class denition for C#/Java but initialized in the .cpp le for C++.)
Compare the functionality dened in this example to the types of func-
tions summarized in Table 5.1.
5.2.1 Constructors
Constructors are special functions that are responsible for an internal and
controlled initialization of objects upon instantiation. Constructors return
no value and the function name is simply that of the class. e ...