Difference between abstract and interface
abstract and interface
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Aug 18, 2011, 9:08 PM EDT
Please look at our recommended articles section.
Thanks
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 9:11 PM EDT
Read,
Abstract Class vs Interface
Abstract Class, Interface and relation to Method Overriding and Method Hiding in C#
What is an Interface?
Abstract Classes And Methods
Satyapriya NayakRank #47 · 31.5K reputationPosted Aug 18, 2011, 9:22 PM EDT
Abstract class
A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.
An abstract class is a special kind of class that cannot be instantiated. It normally contains one or more abstract methods or abstract properties. It provides body to a class.
Interface
An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.
It's an abstract class with public abstract methods all of which must be implemented in the inherited classes.
In which Scenario you will go for Interface or Abstract Class?
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. Even though class inheritance allows your classes to inherit implementation from a base class, it also forces you to make most of your design decisions when the class is first published.
Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. They also version well, because if additional functionality is needed in derived classes, it can be added to the base class without breaking code.
Difference Abstract class vs Interface
In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.Thanks
If this post helps you mark it as answer
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Aug 18, 2011, 9:43 PM EDT
better to ask this type of questions in interview corner section ..
Click Here
Vilas GiteRank #951 · 2.1K reputationPosted Aug 18, 2011, 10:20 PM EDT
Hi Jon,
Read Our recommended articles
And go through with by jitu, provide very good link.
If this reply helps your post…then check "This is correct answer"