Adding Methods to Classes

Methods are functions and subroutines that just happen to belong to a class or structure. We covered structures in Chapter 5, so all of our examples will be demonstrated using classes in this chapter.

Anything you can do with a procedure in a module, you can do with a procedure in a class. The only rule when it comes to methods is subjective measure of good taste. Personally, I like Beethoven and the rock band Creed, so my tastes are probably different than yours. Does this mean that all bets are off when it comes to implementing methods? The answer is both yes and no.

If you are the designer and programmer, you can do whatever you want. If you don't have to get paid for the code you write, you can go nuts. There are ...

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.