C#中的接口不能包含运营商 [英] C# interface cannot contain operators

查看:83
本文介绍了C#中的接口不能包含运营商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以请解释为什么C#接口不允许包含运营商?

Can anyone please explain why C# interfaces are not allowed to contain operators?

感谢。

推荐答案

C#运营商必须是静态。接口,根据定义,适用于实例。没有机制需要一个类型来实现的静态方法。

C# operators have to be static. Interfaces, by definition, apply to instances. There is no mechanism to require a type to implement static methods.

这篇关于C#中的接口不能包含运营商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆