C#中继承,多态性和接口的恰当示例 [英] Decent Example of Inheritance, Polymorphism and Interfaces in C#

查看:114
本文介绍了C#中继承,多态性和接口的恰当示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道是否有人知道一个C#程序,该程序演示了C#中的继承和多态性(以及可能的接口).我看过很多书,虽然它们给出了小的编码示例,但我似乎找不到更多的真实世界"示例.我了解了这些主题的内容,但是(为了我自己的利益)发现编写代码很困难,而又看不到大量的代码.谢谢Brian,

解决方案

<问题是,任何适当地"证明那些特征的东西要么是很小的(如您可能已经看到的那样),以突出那些特定的功能,要么是很大的(因为它是真实世界,因此没有试图向您展示任何东西).

您最好阅读一本书或其他教程-现实世界中的应用程序假定您知道这些知识,因此不会尝试向您展示您想看的东西!这样一来,甚至很难看清事情为何按原样完成.


在这里看看..
可能对您有帮助
继承介绍,C#中的多态性 [ 解决方案

The problem is that anything which "properly" demonstrates those is either going to be small - as you have probably seen - in order to highlight those specific features, or large (because it is real world and thus not trying to show you anything).

You are probably best off looking a a book, or other tutorial - real world apps assume that you know this stuff, so won''t try to show you the bits you want to see! It can then be even harder to see why things are done the way they are.


Take a look over here..
may be helpful for you
Introduction to inheritance, polymorphism in C#[^]


这篇关于C#中继承,多态性和接口的恰当示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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