In programming languages and type theorypolymorphism (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)

Polymorphism (computer science)的更多相关文章

  1. Discovering the Computer Science Behind Postgres Indexes

    This is the last in a series of Postgres posts that Pat Shaughnessy wrote based on his presentation ...

  2. [转载] A set of top Computer Science blogs

    This started out as a list of top Computer Science blogs, but it more closely resembles a set: the o ...

  3. Computer Science Theory for the Information Age-4: 一些机器学习算法的简介

    一些机器学习算法的简介 本节开始,介绍<Computer Science Theory for the Information Age>一书中第六章(这里先暂时跳过第三章),主要涉及学习以 ...

  4. Computer Science Theory for the Information Age-1: 高维空间中的球体

    高维空间中的球体 注:此系列随笔是我在阅读图灵奖获得者John Hopcroft的最新书籍<Computer Science Theory for the Information Age> ...

  5. Intro to Computer Science Class Online (CS101) - Udacity

    Intro to Computer Science Class Online (CS101) - Udacity Building a Search Engine

  6. MIT Introduction to Computer Science and Programming (Lesson one )

    MIT Introduction to Computer Science and Programming (Lesson one ) 这篇文是记载 MIT 计算机科学及编程导论 第一集 的笔记 Les ...

  7. CSCI 1100 — Computer Science 1 Homework

    CSCI 1100 — Computer Science 1 Homework 8CS1 Multiverse: ClassesOverviewThis homework is worth 100 p ...

  8. How do you explain Machine Learning and Data Mining to non Computer Science people?

    How do you explain Machine Learning and Data Mining to non Computer Science people?   Pararth Shah, ...

  9. Mathematics for Computer Science (Eric Lehman / F Thomson Leighton / Albert R Meyer 著)

    I Proofs1 What is a Proof?2 The Well Ordering Principle3 Logical Formulas4 Mathematical Data Types5 ...

随机推荐

  1. [bzoj1923]外星千足虫[高斯消元]

    高斯消元解异或方程组 #include <iostream> #include <algorithm> #include <cstdio> #include < ...

  2. 中国移动MySQL数据库优化最佳实践

    原创 2016-08-12 章颖 DBAplus社群 本文根据DBAplus社群第69期线上分享整理而成,文末还有书送哦~ 讲师介绍章颖 数据研发工程师 现任中国移动杭州研发中心数据研发工程师,擅长M ...

  3. Mac下使用OpenMP

    Mac下使用OpenMP,修改Build Options 下面的compiler for c/c++/objective-C 为 LLVM GCC 4.2 - Language 则可以找到Enable ...

  4. 使用kotlinc、kotlin、java命令进行kotlin程序运行

    使用kotlinc.kotlin.java命令进行kotlin程序运行 学习了:https://www.cnblogs.com/ShaYeBlog/p/7280452.html kotlinc xxx ...

  5. oracle强化练习之单行函数

    1.      显示dname和loc中间用-分隔 Select dname ||'-'|| loc From dept; 2.      将部门名称左填充为10位 Select lpad( dnam ...

  6. Pycharm之Terminal使用

    相当于doc命令,即工程所在目录shift+右键命令窗口打开的doc 1.清屏  ------   cls 清除屏幕上的所有显示,光标置于屏幕左上角.

  7. Java-CyclicBarrier的简单样例

    内容:一个主任务等待两个子任务,通过CyclicBarrier的await()实现.此Runnable任务在CyclicBarrier的数目达到后,全部其他线程被唤醒前被运行. public clas ...

  8. QT 相关资源(书籍、论坛、博客等。。。)整理

     QT 相关资源(书籍.论坛.博客等...)整理... 中文名:<提问的智慧> 英文名:How To Ask Questions The Smart Way 中文链接1:http://ww ...

  9. canvas制作饼图和环形图,使用Excanvas兼容IE67

    excanvas 地址:http://excanvas.sourceforge.net/ <!DOCTYPE html> <html> <head> <met ...

  10. 将tflearn的模型保存为pb,给TensorFlow使用

    参考:https://github.com/tflearn/tflearn/issues/964 解决方法: """ Tensorflow graph freezer C ...