Polymorphism (computer science)
2024-10-01 06:02:35
In programming languages and type theory, polymorphism (from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape") is the provision of a single interface to entities of different types.[1] A polymorphic type is one whose operations can also be applied to values of some other type, or types.[2] There are several fundamentally different kinds of polymorphism:
- Ad hoc polymorphism: when a function has different implementations depending on a limited range of individually specified types and combinations. Ad hoc polymorphism is supported in many languages using function overloading.
- Parametric polymorphism: when code is written without mention of any specific type and thus can be used transparently with any number of new types. In the object-oriented programming community, this is often known as generics or generic programming. In the functional programming community, this is often shortened to polymorphism.
- Subtyping (also called subtype polymorphism or inclusion polymorphism): when a name denotes instances of many different classes related by some common superclass.[3]
https://en.wikipedia.org/wiki/Polymorphism_(computer_science)
最新文章
- easyui 数据库修改部分(基于数据添加逻辑功能修改)
- Java的泛型反射
- jquery 让滚动条处于div底部
- 【原创】使用Fiddler抓取手机网络包
- redis基本配置和相关设置
- 【BZOJ 2820】YY的GCD
- VBS 相关知识 笔记
- 利用Cydia Substrate进行Android HOOK(二)
- python的闭包与装饰器
- 成都Uber优步司机奖励政策(2月21日)
- Area - POJ 1265(pick定理求格点数+求多边形面积)
- sqlsever连接两个不同服务器上的数据库进行查询
- 关于onclick中的event对象和element对象
- pexpect-pxssh-登陆Linux-执行命令
- 2007LA 3902 网络(树+贪心)
- Kafka入门 --安装和简单实用
- mac 苹果多版本jdk自由切换
- 【linux】Linux误删C基本运行库libc.so.6急救方法
- sam9260 adc module
- 【xsy1143】 兔子的数字 搜索
热门文章
- Element 'dependencies' cannot have character[children],because the type's content type is elemen
- py文件控制台执行时,报错:引入的模块不存在
- RSA 数据加密和数字签名算法
- Android: Could not find com.android.support:support-v4:21.0.0
- c++ 双冒号的作用
- 安装 KB2844286 导致SharePoint 2010 XSLT web part 显示出现错误
- vue组件的一个总结
- 阻尼滑动--能够滑动过度的ScrollView(OverScrollView)
- hdu4289 Control --- 最小割,拆点
- 最全Linux 与 Linux Windows 文件共享