Hi Friends ,
Why should we use abstract class ? All the features of abstract class we can achieve by the classes and interface.
The override function can be done by the interfaces and classes.
Loading
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 attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 14, 2011, 6:22 AM EDT
1. It can contain non-abstract instance methods and properties.
2. It can contain static methods and properties.
3. It can contain instance and static fields.
4. It can contain constants, operators and nested classes or structs.
5. Members don't necessarily have to be public, they can be internal, protected or private as well.
Of course, the drawback of abstract classes is that you can only inherit from one of them, whereas you can implement multiple interfaces as well as inherit from a single non-abstract class.
Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 14, 2011, 6:23 AM EDT
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.
Thanks
Prabhu RajaRank #861 · 2.6K reputationPosted Sep 14, 2011, 9:38 AM EDT
---------------------------------------------------------------------------------------