Thursday, March 16, 2006

What is the difference between classes and modules?

Q: What is the difference between classes and modules?

A: Visual Studio.Net stores code in either classes or modules. Classes are used for items that define their own storage and have persistent data. In addition classes must be instantiated before they're used, unless the keywords "Static" (C#) or "Shared" (VB.Net) are used.
Modules, on the other hand, can be viewed as simple code libraries where the methods can be called directly.

No comments: