.NET Framework How to create an object of T using Reflection


Example

Using the default constructor

T variable = Activator.CreateInstance(typeof(T));

Using parameterized constructor

T variable = Activator.CreateInstance(typeof(T), arg1, arg2);