Answers

Question and Answer:

  Home  Senior .Net Developer

⟩ Explain me what is the difference between an abstract class and an interface?

An abstract class is always used as a base class. It provides some abstract/virtual members that the inheriting entities must implement, as well as a partial implementation for a functionality. For extra credit, job candidates might mention that this class can also declare fields. Developers cannot create an object from this class.

An interface, on the other hand, can declare properties, methods and events only (no access modifiers). The developer must implement all declared members. In short, an interface designates a contract/behavior that implementing classes should have.

 145 views

More Questions for you: