C# | Interface vs Class
Difference between a class and an interface The basic difference is that a class has both a definition and an implementation whereas an interface only has a definition. Interfaces are actually implemented via a class. (Due to this an interface supports the concept of multiple inheritances.) Interfaces are developed in C# to implement the concept of multiple inheritance whereas classes are not used to implement multiple inheritance. No memory is allocated for the interfaces whereas the memory is allocated for the classes. Classes are templates for objects. The attributes of objects are defined by the components of the class, that describe the state and behavior of objects. A class contains attributes, methods and events as its components. Interfaces contain only method prototypes, they don't provide an implementation of its methods, we can provide an implementation of its methods in our class, for that we can implement the interface. An interface is the source for polymorp...