O'Reilly logo

Special Edition Using C# by NIIT

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

Interface Declaration

An interface is a reference type that contains only abstract members. The members an interface can contain are events, methods, properties, and indexers. However, an interface can contain only the declaration of these members. The implementation of these members must be present in the classes that implement the interface. An interface cannot contain constants, fields, constructors, destructors, or static members. This is because the purpose of an interface is to define a contract and constants, fields, constructors, destructors, and static members do not help in defining a contract. An interface defines a standard, which the implementing class should then follow.

An interface declaration uses the following syntax:

						attributes ...

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