LANGUAGE
new() constraint
Requires a public parameterless constructor and a non-abstract type; allows new T().
Formal Syntax & Structure
csharp syntaxcsharp
where T : new()Working Example
Example Snippetcsharp
static T Create<T>() where T : new() => new T();