Is something like this possible in C#? What about CLR in general?
public sealed-outside class MySample
{
}
Is something like this possible in C#? What about CLR in general?
public sealed-outside class MySample
{
}
Only if you declare all constructors internal. Then only classes within the same assembly will be able to call a base class constructor which is required for inheritance. You may need some public static factory methods if others need to be able to create an instance.
If you want to be pedantic, this only prevents inheritance at the language level, not the CLR level. You could still technically create an inheriting class by declaring some mutually recursive constructors. Jon Skeet demonstrated this in an example.