22.10 Classes Versus Modules
Finally, let's wrap up this
chapter
by comparing the topics of this book's last two
parts—modules and classes. Since they're both
about namespaces, the distinction can sometimes be confusing. In
short:
- Modules
-
- Classes
Classes also support extra features modules don't,
such as operator overloading, multiple instance generation, and
inheritance. Although both are namespaces, we hope you can tell by
now that they are very different things.
|