I would like to do the same thing I do in Java with the final keyword. I tryed to use const keyword... but it doesn't work. How can I prevent other class to inherit from my class?
Or, more specifically, "sealed". :)
Vilx-
2008-12-12 20:28:50
edited to fix :)
annakata
2008-12-12 20:30:41
Yeah, thanks you are right, I added the link to it. It's sealed (to seal!). I have to agree that I do not use this keyword a lot.
Daok
2008-12-12 20:31:15
+1
A:
In general you should mark your type with sealed keyword in case you want prevent derivation. However is some cases it is not appropriate. For example, you want to allow types from your assembly to derive from your publicly accessible type but prevent third parties from derivation.
Here few tricks which allow you to do this:
Dzmitry Huba
2008-12-13 21:19:17