C#: A Beginner's Guide (Beginners Guides) by Pat McGee

C#: A Beginner's Guide (Beginners Guides) by Pat McGee

Author:Pat McGee
Language: eng
Format: mobi, epub
Publisher: McGraw-Hill Education
Published: 2015-01-02T08:00:00+00:00


Chapter 12

Interfaces

Key Skills & Concepts

Interface Syntax

Interface Hierarchies

Generic Interfaces

Existing .NET Interfaces

Interfaces declare public data members and methods that must be implemented in a class or struct. Interfaces are similar to abstract classes since interfaces also do not permit a base implementation. So why bother going through the trouble of creating an interface to enforce implementation of public members? A class can implement multiple interfaces but can inherit only from one base class. The interface, of course, also helps to enforce good object-oriented design. Understanding interfaces will also help with your understanding of really important C# structures like collections and LINQ. You might even need to use interfaces to enforce consistent accessibility for a series of classes in your own projects.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.