编译时通过,运行时抛出异常:System.MissingMethodException: No parameterless constructor defined for this object.
这个对象没有不使用参数的构造器。我平时用new来产生数组引用的时候,比如stirng[] strs = new string[SIZE]; 拿来就用了,根本没想过new一个数组也是需要调用构造函数的。
构照函数中缺少默认无参数的构照函数
编译时通过,运行时抛出异常:System.MissingMethodException: No parameterless constructor defined for this object.
这个对象没有不使用参数的构造器。我平时用new来产生数组引用的时候,比如stirng[] strs = new string[SIZE]; 拿来就用了,根本没想过new一个数组也是需要调用构造函数的。
构照函数中缺少默认无参数的构照函数