可能重复: Interface定义一个构造函数签名?
我知道,你不能在.NET中的接口指定一个构造函数,但为什么我们不能?
I know that you cannot specify a constructor in an interface in .Net, but why can we not?
这将是非常有益的我当前的项目,以便能够指定一个引擎必须通过在构造函数中,但我不能,我一定要足够用在类的XML注释。
It would be really useful for my current project to be able to specify that an 'engine' must be passed in with the constructor, but as I cant, I have to suffice with an XML comment on the class.
由于接口描述的行为。构造函数不是行为。对象是如何建立是一个实现细节。
Because an interface describes behaviour. Constructors aren't behaviour. How an object is built is an implementation detail.
上一篇:我应该总是使用AndAlso和OrElse运算经营者?经营者、AndAlso、OrElse
下一篇:防爆$ P $类型'System.Int32的“的pssion不能用于返回类型'System.Object的'类型、System、Object、pssion