What Is an Interface?
To understand what an interface is let's start with an analogy. Any of the tools in a Swiss army knife is analogous to an interface. A Swiss army knife has a set of tools, such as a blade, can opener, screwdriver, and so on. But it is still a Swiss army knife; it is neither a blade, nor a can opener. It can perform the same actions as a can opener or a screwdriver, without being one. From the point of view of someone who needs a can opener, a Swiss army knife acts like a can opener. From the point of view of someone who needs a screwdriver, the same Swiss army knife is a screwdriver. In programming you would say that the can opener, blade, and so on are interfaces that define certain capabilities, and the Swiss army knife ...
Get Visual Basic® .NET by Example 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.