Plz.......
how will we call abstract class without inherit class?
how will we restrict inherit class without sealed?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Arunava BhattacharjeePosted Oct 27, 2014, 11:57 PM
2. You can make the class as "Static" or you can make the constructor as "Private"
If this answers your question, please mark it as accepted.
Ajay YadavPosted Oct 27, 2014, 10:16 PM
VulpesPosted Oct 27, 2014, 2:54 PM
However, abstract classes can also include static members and, provided these are public or internal, you can access them from a non-derived class.
You can effectively prevent a class from being inherited from without the use of the sealed keyword by giving it only a private constructor. This won't be accessible from derived class constructors which always need to, implicitly or explicitly, call their base class's constructor. Consequently, any attempt to create a derived class will fail in these circumstances.