Implementing and Accessing Interfaces

Implementing interfaces means telling a class that it needs to expose all members defined within the interface. This task is accomplished by using the Implements keyword followed by the name of the interface. The following code snippet shows how to implement the IDocument interface within a Document class:

image

You immediately notice that, when pressing Enter, the Visual Studio IDE automatically generate members’ templates for you. This is useful: You do not need to waste your time in writing members’ signatures. You also notice that when a member is defined within a class because of the interface implementation, ...

Get Visual Basic® 2010 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.