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. Android实现ViewPager无限循环滚动回绕

     Android实现ViewPager无限循环滚动回绕 Android系统提供的ViewPager标准方式是左右可以自由滑动,但是滑动到最左边的极限位置是第一个page,滑动到最右边的位置是最后一 ...

  2. fzu 2128

    第一组实例 aaaa 2 aa aa 第二组 a 1 c 第三组 abcdef 2 abcd bcd 第四组 abcdef 2 abcd bcde 第五组 aaaa 2 a aa 第六组 lgcstr ...

  3. cogs 22. [HAOI2005] 路由选择问题

    22. [HAOI2005] 路由选择问题 ★★★   输入文件:route.in   输出文件:route.out   简单对比时间限制:1 s   内存限制:128 MB [问题描述] X城有一个 ...

  4. JQuery获取select选中值和清除选中状态(转)

    1.获取值 var provinceSearch = $("#loc_province_search").find("option:selected").att ...

  5. ubuntu上java的开发环境 jdk 的安装

    jre下载路径: https://java.com/zh_CN/download/manual.jsp jdk下载路径:http://www.oracle.com/technetwork/java/j ...

  6. HDOJ 4857 逃生

    BestHack.....真乱..... 逃生 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/ ...

  7. java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

    1.错误描写叙述 java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String service. ...

  8. 回调函数实现类似QT中信号机制(最简单)

    1. 定义回调接口类: class UIcallBack{public: virtual void onAppActivated() = 0; virtual void onShowMore() = ...

  9. QT 4.53 for VS2005 编译包

    最近学QT,装了QT5,结果打开下载的项目(特别是那些书的源代码)有很多兼容性问题.于是又下载4.83,都是4版本系列的,应该会好很多吧,但居然也是这样.于是看了一下时间,觉得4.53于2009年底发 ...

  10. servlet中的中文乱码问题

    老师总会说道:学完这个知识点,我们来谈谈中文乱码问题. 乱码的问题总是无处不在,处理不好会给用户带极差的用户体验. 那么我们来记录一下servlet中的乱码问题吧! 1.服务器向客户端响应时出现的乱码 ...