Abstract Class
-
Abstract Class ? In which Scenarios use it over Interface?
Raghu RR
-
Abstract Class ? In which Scenarios use it over Interface?
Raghu RR
An interface defines the signatures for a set of members that implementers must provide. Interfaces cannot provide implementation details for the members. For example, the ICollection interface defines members related to working with collections. Every class that implements the interface must supply the implementation details for these members. Classes can implement multiple interfaces. Classes define both member signatures and implementation details for each member. Abstract classes can behave like interfaces or regular classes in that they can define members, and they can provide implementation details but are not required to do so. If an abstract class does not provide implementation details, concrete classes that inherit from the abstract class are required to provide the implementation. So here you can see the difference. Based on the understanding about your requirements in the project. You should implement either Interface of abstract class.