O'Reilly logo

The C# Programming Language (Covering C# 4.0), Fourth Edition by Peter Golde, Scott Wiltamuth, Mads Torgersen, Anders Hejlsberg

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

13. Interfaces

An interface defines a contract. A class or struct that implements an interface must adhere to its contract. An interface may inherit from multiple base interfaces, and a class or struct may implement multiple interfaces.

Bill Wagner

Interfaces work best when they are small in scope and few in number. Larger interfaces create more work for implementers. Larger numbers of interfaces provide more opportunities for ambiguity and collisions.

Eric Lippert

The trope that interfaces are contracts is undoubtedly both useful and frequently stated. It’s worth pointing out an interface is actually a pretty weak way to represent a contract. All an interface tells you is which methods are available, what their names are, which types ...

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