79077501

Date: 2024-10-11 08:59:18
Score: 1
Natty:
Report link

It's not clear what you mean by

In the class hierarchy below, how to define type constraint for T (where T : class, new())?

while you could simply add where T : class, new() but if you having trouble with figuring out where to put where T : class, new() it should be something like this:

abstract class AbstractComponent<T> : Parent, IComponentType, IRelationship
where T : class, new() {}
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: محمد نظرخانی