•1. An abstract class can have abstract members as well non abstract members. But in an interface all the members are implicitly abstract and all the members of the interface must override to its derived class.
•2. It is not mandatory to override abstract method in the derived class. But in case of Interface it’s mandatory. •3. A class can inherit one or more interfaces, but only one abstract class. •4. Abstract classes can add more functionality without destroying the child. But In case of an interface, creation of additional functions will have an effect on its child classes, due to the necessary implementation of interface methods to classes. •5. Abstract class members can have access modifiers where as interface members cannot have access modifiers. • •The selection of interface or abstract class depends on the need and design of your project. You can make an abstract class, interface or combination of both depending on your needs.Dot Net Office
Oops Tutorials in C#
Part 10 - Interface and Abstract class in C# | Oops Tutorials in C# | Oops Concept
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
Subscribe to:
Post Comments (Atom)
EmoticonEmoticon