latest Post

Difference between Abstract Class and Interface in C#

Abstract Class


  1. Abstract class is inherited.
  2. We cannot create an object of abstract class.
  3. Abstract class does not support multiple inheritance.
  4. Abstract class contains Constructors.
  5. An abstract class may  contain abstract methods as well as concrete methods(non- abstract methods).
  6. Only Complete Member of abstract class can be Static.
  7. Class inheriting an abstract class has to override the abstract methods from abstract class while implementing them.


Interface


  1. Interface is not inherited but it is implemented.
  2. We can create an object of interface by type casting it to class name.
  3. Interface support multiple inheritance.
  4. Interface doesn’t contains Constructors.
  5. An interface Contains only the declaration of the method.
  6. Member of interface can not be Static.
  7. Class implementing an interface has to implement all the methods of the interface compulsorily.

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment