Inheritence
I want to know that can we prevent our class from being inherited and if yes then how?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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 Dec 19, 2011, 7:10 PM EST
Using sealed keyword we can prevent a class from being inherited.
Please refer the below link
http://www.c-sharpcorner.com/UploadFile/mahesh/SealedClasses11142005063733AM/SealedClasses.aspx
Thanks
VulpesRank #55 · 29.2K reputationPosted Dec 20, 2011, 12:01 AM EST
You can also prevent virtual methods from being further overridden in derived classes by adding the 'sealed' modifier.