C# 利用反射完成计算器可扩展功能时间:2023-03-09 00:41:55 type.IsSubclassOf(typeof(Operation));//判断类型是否是某个类型的子类 type.IsAbstract;//判断类型是否是抽象类 Activator.CreateInstance(type, n1, n2);//创建实例,后面是构造函数参数