Senior .Net Developer Question:

Tell us the differences between an Interface and an Abstract Class in .NET?

Senior .Net Developer Interview Question
Senior .Net Developer Interview Question

Answer:

An interface merely declares a contract or a behavior that implementing classes should have. It may declare only properties, methods, and events with no access modifiers. All the declared members must be implemented.

An abstract class provides a partial implementation for a functionality and some abstract/virtual members that must be implemented by the inheriting entities. It can declare fields too.

Neither interfaces nor abstract classes can be instantiated.


Previous QuestionNext Question
Please explain when should you use .NET Web Forms over ASP.NET MVC?Please explain what is immutability, what is it for and how is it codified?