Interfaces

The concept of interfaces offers you another possibility for standardizing classes. Similar to abstract classes, interfaces serve to create rules that regulate such things as certain members being required within classes derived from those interfaces. As opposed to abstract classes, however, interfaces contain only these rules—they do not contain code. What’s interesting is that classes in .NET can inherit only from one class—but can implement any number of interfaces (unlike C++, in which multiple inheritance is possible, and sometimes confusing). You can think of interfaces in .NET as being similar to interfaces in daily life: a class (an object), for example a Notebook derived from the base class Computer, can implement several interfaces. ...

Get Microsoft® Visual Basic® 2010 Developer’s Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.