C# Activator //free\\ · Popular & Proven
// Assuming a class with constructor: public User(string name, int age) object[] args = new object[] { "John Doe", 30 }; object userInstance = Activator.CreateInstance(userType, args);
// Assuming a class with constructor: public User(string name, int age) object[] args = new object[] { "John Doe", 30 }; object userInstance = Activator.CreateInstance(userType, args);