Summary of Some Properties of Classes

Below is a list of some points to keep in mind when defining classes:

  1. Classes have both member variables and member functions.

  2. A member (either a member variable or member function) may be either public or private.

  3. Normally, all the member variables of a class are labeled as private members.

  4. A private member member of a class cannot be used except within the definition of another member function of the same class.

  5. The name of a member function for a class may be overloaded just like the name of an ordinary function.

  6. A class may use another class as the type for a member variable. (Hierarchical classes)

  7. A function may have formal parameters whose types are classes.

  8. A function may return an object; that is, a class may be the type for the value returned by a function.

  9. You can overload member functions of a class in the same way as an ordinary function is overloaded.