声明相同的方法名称和相同的签名..是否可以在C#中? [英] Declare same method name and same signature ..Is it possible in C# ?

查看:45
本文介绍了声明相同的方法名称和相同的签名..是否可以在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

声明相同的方法名称和相同的签名..是否可以在C#中使用?







接口I1

{



int Add(int i1,int i2);



int Add(int i1,int i2);



}

class chileClass:I1

{



//如果可能,我如何实施?

}

Declare same method Name and same signature ..Is it possible in C# ?

Like

Interface I1
{

int Add(int i1, int i2);

int Add(int i1, int i2);

}
class chileClass : I1
{

//How can I implement here if that is possible?
}

推荐答案

我不相信这是可能的,你为什么要这样做?
I do not believe this is possible, why would you want to do that?


不可能,因为它没有意义:你怎么样(和编译器和运行时)会区分两者吗?
No it is not possible, because it makes no sense: how do you (and the compiler and the runtime) would distinguish between the two?


不,它不可能。让我们知道要求,以便我们给您一些想法
No, its not possible. Let us know the requirement so we might give you some idea


这篇关于声明相同的方法名称和相同的签名..是否可以在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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