开发者

why the interface cannot have static member method [duplicate]

This question already 开发者_如何学Pythonhas answers here: Closed 12 years ago.

Possible Duplicate:

Why shouldn't C#(or .NET) allow us to put a static/shared method inside an interface?

Why we cannot define static method inside interface?


From the top search result in Google:

Because an interface is a "contract" or an agreement between the consumer (caller) and the provider (callee). An interface describes what and how the calle will provide functionality. There is no need for static members provided by a third party. Static members cannot be overridden by a provider so they do not belong in an interface.

Stefan Rusek

08 February 2006

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜