Same Old Question….Abstract Class & Interface

Abstract Class: Cannot be instantiated, contract that forces all the subclasses to carry on the same hierarchies or standards

Interface: No Implementation, When we create an interface, we are basically creating a set of methods without any implementation that must be overridden by the implemented classes

A class can implement more than one interface but can only inherit from one abstract class. Since C# doesn’t support multiple inheritance, interfaces are used to implement multiple inheritance.

When we create an abstract class, we are creating a base class that might have one or more completed methods but at least one or more methods are left uncompleted and declared abstract. If all the methods of an abstract class are uncompleted then it is same as an interface. The purpose of an abstract class is to provide a base class definition for how a set of derived classes will work and then allow the programmers to fill the implementation in the derived classes.

http://www.aspdotnet-suresh.com/2010/04/abstract-versus-interface.html

Leave a comment