What are the differences between an interface and an abstract class in .net?



What are the differences between an interface and an abstract class in .net?..

Answer / Durgesh Kumar Mishra

An interface defines a contract that a class must implement, but it doesn't provide any implementation. An abstract class can contain both method declarations (abstract methods) and implementation for those methods. An interface can also define properties, events, and indexers, while an abstract class cannot have events or indexers. Multiple classes can implement the same interface, but a class can only inherit from one abstract class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

How to get the hostname or IP address of the server?

2 Answers  


How many namespaces are in .net version 1.1?

1 Answers  


Explain the difference between public and static modifiers?

1 Answers  


What is concurrency? How will you avoid concurrency when dealing with dataset?

1 Answers  


What is UDDI and how to register the web service in it?

1 Answers   TCS,


What is .net debug & trace?

1 Answers  


What is the difference between constants and read-only variables?

1 Answers  


How to write an MMC snap-in for my Windows service?

1 Answers  


What is "common language specification" (cls) in .net?

1 Answers  


Explain code access security.

1 Answers  


Please explain what inheritance is, and why it's important?

1 Answers  


What's singleton activation mode in .net?

1 Answers  


Categories