Summary of Some Properties of Classes
Below is a list of some points to keep in mind when defining classes:
-
Classes have both member variables and member functions.
-
A member (either a member variable or member function) may be either public or private.
-
Normally, all the member variables of a class are labeled as private members.
-
A private member member of a class cannot be used except within the definition of another member function of the same class.
-
The name of a member function for a class may be overloaded just like the name of an ordinary function.
-
A class may use another class as the type for a member variable. (Hierarchical classes)
-
A function may have formal parameters whose types are classes.
-
A function may return an object; that is, a class may be the type for the value returned by a function.
-
You can overload member functions of a class in the same way as an ordinary function is overloaded.