C#中方法的单个实现 [英] A single implementation for a method in C#

查看:81
本文介绍了C#中方法的单个实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hare Krishna,您好,


我想知道C#是否有一个设施,我可以为两个不同类中的两个不同类使用的方法定义一个单独的实现heirarchies?现在让我用一个例子说明问题。

我有一个''猫'级和一个'狗'级:

Hare Krishna, Hi,

I wanted to know if C# has a facility whereby i can define one single implementation for a method that is used by two different classes in two different class heirarchies? Now let me illustrate the problem with an example.
I have got a ''cat'' class and a ''dog'' class:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号

推荐答案

转到.NET论坛。



转到.NET论坛。
Moving to .NET forum.



对不起。发布帖子后我也意识到了这个错误。我试图找出如何将其移至.Net论坛。你能告诉我怎么样吗?

I am sorry. I also realized the mistake after posting the thread. I trying to figure out how to move it to the .Net forum. Could you please tell me how?



对不起。发布帖子后我也意识到了这个错误。我试图找出如何将其移至.Net论坛。你能告诉我怎么样吗?
I am sorry. I also realized the mistake after posting the thread. I trying to figure out how to move it to the .Net forum. Could you please tell me how?



我现在搬了。将来点击报告按钮,让主持人为您移动。

I''ve moved it now. In the future click on the report button and ask a moderator to move it for you.


这篇关于C#中方法的单个实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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