C#

What is Interface?

Written by shohal

Interface

An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by structs and classes, that must provide an implementation for each interface member declared.

Why to use an interface

•Inheritance allows creating classes that are derived from other classes, so that they automatically include some of its “parent’s” members, plus its own. The following are types of inheritances.

•Multiple inheritance is possible in C++ but it’s not possible in C#.

About the author

shohal

Leave a Comment