Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Interface Definition

Interface Definition

Interface definitions are enclosed within the Interface and End Interface statements. Following the Interface statement, you can add an optional Inherits statement that lists one or more inherited interfaces. The Inherits statements must precede all other statements in the declaration except comments. The remaining statements in the interface definition should be Event, Sub, Function, and Property statements. Interfaces cannot contain any implementation code or statements associated with implementation code, such as End Sub or End Property.

Interface statements are public by default, but they can also be explicitly declared as Public, Friend, Protected, or Private.

Note   The only valid modifiers for Sub, Function, or Property statements declared in an interface definition are the Overloads and Default keywords. None of the other modifiers — Public, Private, Friend, Protected, Shared, Static, Overrides, MustOverride, or Overridable — are allowed.

See Also

Interfaces Overview | Interface Statement | Implements Keyword | Interface Implementation Examples | When To Use Interfaces | Creating and Implementing an Interface | Walkthrough: Creating and Implementing Interfaces | Inheritance | Inherits Statement | Overloads | Default

Show:
© 2015 Microsoft