Introduction to interfaces in C sharp Arabic #29
Suggested Videos
Difference between classes and structs in C sharp Arabic #28
❑ Interfaces basics
interfaces
❑ We create interfaces using interface keyword .just like classes interfaces also contains properties ,methods ,delegates or events, but only declarations and no implementations
❑ It is a compile time error to provide implementations for any interface member.
❑ Interface members are public by default , and they don’t allow explicit access modifiers.
❑ Interfaces cannot contain fields.
❑ If a class or a struct inherits from an interface, it must provide implementation for interface members, otherwise, we get a compiler error.
❑ A class or a struct can inherit from more that one interface at the same time, but where as, a class cannot inherit from more that once class at the same time.
❑ Interfaces can inherit from other interfaces. A class that inherits this interface must provide implementation for all interface members in the entire interface inheritance chain.
❑ We cannot create an instance of an interface, but an interface reference variable can point to a derived class object.
Follow Us
If you want to download pptx : click Telegram