Three ways to restrict a class from being inherited?
I need to know at least three ways to restrict a class from being inherited
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.
YashPosted May 17, 2009, 5:20 AM
Marcel van DrielPosted May 16, 2009, 7:52 AM
- Declare it sealed (most obvious solution)
- If it's in another assembly, don't make it public (can't inherit what you can't see).
- You also cannot inherit from a static class.
Not sure if this answers your question, but there you go.