Limit what classes can extends another class
<p>I'm currently writing a solution that contains some abstract classes. One of these should only be extended from a few other classes as using it from other places than intended could cause a little bit of a mess. So what I want to do is limit what classes can extend this class.</p>

<p>So if I have a class named ImportantStuff which is abstract I want to say that only Class A and Class B are able to extend it while any other class can't.</p>

<p>You might wonder why I would want to do something like this. Well the code is written for work so there will be lots of other programmers working with it later, so I wish to make it clear for those that this class is not intended to be used from any other places than it already is. Yes I know I can write it in a class description and I have, but I want to make it 100% clear by blocking it as not all programmers are good at reading comments:) Also I'm kinda curious if it can be done in a good fashion as I couldn't find a good answer on the web.</p>

<p>So my question is: what is the <strong>best</strong> way to make this happen? I guess I can send a key or something that is handled in the constructor, but is there a cleaner way to do this?</p>
