什么是c#.net中的ad-hoc多态性 [英] What is ad-hoc Polymorphism in c#.net

查看:85
本文介绍了什么是c#.net中的ad-hoc多态性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是朋友,我对c#.net中的Ad-hoc多重主义感到困惑。某些网站的重载以及其他网站覆盖。 Ad-hoc多态性是Overload或overriding,并且还给出了一些关于Ad-hoc多态性的例子。

I friends, I have a confusion about Ad-hoc polymarphism in c#.net. Some of the site's given Overloading and in other sites overriding. Ad-hoc polymorphism is Overload or overriding and also give me some examples about Ad-hoc polymorphism.

推荐答案

Christopher Strachey描述了参数多态性和ad-hoc多态性之间的区别在1967年,所以多态性必定已经存在。

请阅读以下内容以获取更多信息:

http://en.wikipedia。 org / wiki / Ad_hoc_polymorphism



Ad-hoc多态性的基础知识

Ad-hoc多态性(也称为函数重载或运算符重载)包括创建具有相同名称但具有不同标题的多个函数。功能可以通过它们的参数',类型和数量来区分。我们说函数Foo()与Foo(int x)不同,Foo(int x)也不同于Foo(float x)
Christopher Strachey described the distinction between parametric polymorphism and ad-hoc polymorphism in 1967, so polymorphism must have already existed then.
Read below for more information:
http://en.wikipedia.org/wiki/Ad_hoc_polymorphism

Basics of Ad-hoc Polymorphism
Ad-hoc Polymorphism (is also known as function overloading or operator overloading) consists in creating multiple functions with the same name but that have different headers. The functions can be differentiated by their parameters', by their type and number. We say that function Foo() is different from Foo(int x) and also Foo(int x) is different from Foo(float x)


在我看来,Ad hoc多态基本上是函数重载或运算符重载的工作不会覆盖。请在此处获取一些好的示例:

广告-hoc Polymorphism [ ^ ]

Ad Hoc Polymorphism意味着什么 [ ^ ]
In my opinion,Ad hoc polymorphism is basically a work of function overloading or operator overloading not overriding.Catch some good example here:
Ad-hoc Polymorphism[^]
What does Ad Hoc Polymorphism mean[^]


这篇关于什么是c#.net中的ad-hoc多态性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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