November 2001
Beginner to intermediate
816 pages
16h 3m
English
The definition of an interface is much like a class or struct. However, since an interface doesn't have an implementation, its members are defined differently. The following example shows how to declare an interface, and how an interface is structured.
[modifiers] interface IName [: Interface [, Interfaces]]
{
// methods
// properties
// indexers
// events
}
The modifiers may be public, protected, protected internal, internal, private, and new. Next is the keyword interface followed by the interface name, IName. A common convention is to make the first character of an interface name the letter I. The name must conform to the C# rules for identifiers. After the name is a colon and a comma-separated list of interfaces that this ...
Read now
Unlock full access