Yesterday, I was explaining C#\'s generic constraints to my friends. When demonstrating the where T : CLASSNAME
constraint, I whipped up something like this:
Well.
public class Implementation : UnusableClass
{
}
is perfectly valid, and as such makes
var unusable = new UnusableClass();
and
UnusableClass.method(new Implementation());
valid.
So, yes, it can be instantiated by supplying an inheriting type as the type parameter, and similarly with the call to the static method. It's for instance useful for tree-like structures where you want to generically specify the type of children the node has, while it being the same type itself.