Hi,
I have learned various class, What is the real life scenario of abstract class,sealed class?
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 attend3days leftRegister
Satyapriya NayakRank #47 · 31.5K pointsPosted Oct 19, 2011, 9:13 AM EDT
Abstract class is a class that can not be instantiated, it exists extensively for inheritance and it must be inherited. There are scenarios in which it is useful to define classes that is not intended to instantiate; because such classes normally are used as base-classes in inheritance hierarchies, we call such classes abstract classes.
Abstract classes cannot be used to instantiate objects; because abstract classes are incomplete, it may contain only definition of the properties or methods and derived classes that inherit this implements it's properties or methods.
Static, Value Types & interface doesn't support abstract modifiers. Static members cannot be abstract. Classes with abstract member must also be abstract.
For detailed example, read this article http://www.dotnetfunda.com/articles/article467-abstract-class--explained.aspx
sealed class:- We cannot inherit from this class.
For detailed example, read this article
http://www.c-sharpcorner.com/UploadFile/mahesh/SealedClasses11142005063733AM/SealedClasses.aspx
Thanks
VulpesRank #55 · 29.2K pointsPosted Oct 19, 2011, 10:41 AM EDT