Visual studio simplifies creating, customizing and enabling interfacing implementations. There are commonly used interfaces as well as customized ones. Implementing interfaces, to cause compliance with standard contracts. It defines a common set of members that all classes that implement the interface must provide. Classes can implement a variety of different multiple interfaces.
A class that implements an interface can explicitly implement members of that interface.
An explicitly implemented member cannot be accessed through a class instance, but only through an instance of the interface.
An interface can inherit from one or more base interfaces. When a base type list contains a base class and interfaces, the base class must come first in the list.
An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface. An interface can be a member of a namespace or a class and can contain signatures of the following members: Methods, Properties, Indexers and Events.
So, interfaces describe a group of dynamic, versatile and related functionalities that can belong to any class or struct/contract. They can consist of methods, properties, events, indexers, or any combination of those four member types. Cannot have or contain any fields. Public user access rights and privileges.
If a base class implements an interface, the derived class inherits that implementation. A class or struct can inherit more than one interface. It inherits only the method names and signatures, because the interface itself contains no implementations.
Key Exam Points
- Review relevant chapters on .NET Fundamentals, Searching, Modifying and Encoding Text, Serialization, Graphics, Interoperating, Multiple-Threading, applications, Domains and Services, Installing and Configuring Application and other uses of a wide variety of interfaces.
- For the exam, work through the practical, lab, real-life and illustrative study examples, exercises for interfaces, that help you to gain a better understanding of this topic.
- Take the practice test, Q&A multiple choice and application questions.
This article is based on the 2nd edition of the Microsoft .Net Framework Application Training Kit with the purpose to help 70-536 Exam takers to succeed. I constantly look for ways to improve the content. Please leave a comment about this article or drop me a message if you would like to see changes for this site.