O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Implements Keyword

Syntax

Implements interfacename.interfacemember [, ...]
interfacename (required; String literal)

The name of the interface being implemented by a class

interfacemember (required; String literal)

The name of the interface property, function, procedure, or event that is being implemented by a class

Description

Indicates that a class member provides the implementation of a member defined in an interface

Rules at a Glance

  • The Implements keyword can only be used in a class module in which the Implements statement has been used to define an abstract base class that the class is to implement.

  • The Implements keyword follows the property, function, procedure, or event definition, and must be on the same line.

  • The class member implementing the interface member must be of the same type (property, function, procedure, or event) as the interface member, and its argument list and, in the case of functions and properties, return type must also be identical to that of the interface member.

  • Class members must implement all of the members declared in the interface.

Example

See the example in the Implements Statement entry.

VB.NET/VB 6 Differences

  • The Implements keyword is new to VB.NET. Its addition means that the implementation of a property, function, procedure, or event does not have to use the name defined by the interface. This modifies the VB 6 practice, which requires that class members that implement an interface definition have the form interfacename_membername.

  • VB 6 does ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required