开发者

why the interface cannot have static member method [duplicate]

开发者 https://www.devze.com 2023-02-06 05:41 出处:网络
This question already 开发者_如何学Pythonhas answers here: Closed 12 years ago. Possible 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

精彩评论

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