Object createObjectBy(Type clazz){
// .. do construction work here
Object theObject = Activator.CreateInstance(clazz);
return theObject;
}
Usage:
createObjectBy(typeof(A));
Or you could simply use Activator.CreateInstance
directly 🙂