Definition of Polymorphism in Computers

Definition of Polymorphism in Computers thumbnail
Programming languages are what software designers use to create computer programs.

One of the core capabilities of object-oriented programming languages is polymorphism. Polymorphism is the ability for an object to be used differently or considered a different type of object depending on the context in which it is used.

  1. Object-oriented Programming

    • Object-oriented programming is a programming paradigm that uses encapsulated entities known as "objects." Objects are groupings of attributes and functions that define a component of the program. For example, a "car" object would have the attributes defining its color, model and brand, and would include functions such as "drive" or "refuel."

    Inheritance

    • Object-oriented programming languages give objects the ability to inherit from other objects, making the new object a subset of its parent. For example, a "square" object could inherit from a "shape" object. The "square" object would then have the attributes and functions defined within the "shape" object, as well as any it defined itself.

    Polymorphism

    • Polymorphism allows objects to be treated differently depending on the context in which they are used. For example, with polymorphism, if a line of code uses a "shape" object, it could also use any objects that inherit from the "shape" object, such as a "square" or "circle" object.

Related Searches:

References

  • Photo Credit computer image by Hao Wang from Fotolia.com

Comments

You May Also Like

  • Definition of Computer Programming Languages

    While humans speak languages laced with metaphor, idioms, inflections and subtext, computers require languages free from these ambiguities in order to function...

  • How to Detect Polymorphism Via FTIR

    FTIR stands for Fourier Transform Infrared Spectroscopy. This method of spectroscopy uses different light wavelengths. The compound absorbs specific wavelengths to ...

  • How to Learn Object Oriented Programming

    Object oriented programming is a powerful programming model used in modern computer languages. All software objects created through object oriented programming ...

  • Definition of DNA Fingerprinting

    DNA fingerprinting is a scientific process in which samples of DNA (deoxyribonucleic acid) are collected and either compared to DNA evidence collected...

  • Computer Languages Used for Computers

    A computer language is a set of commands or actions that a computer can understand and execute. Also known as a "programming...

  • The Advantages of Object Relational Database

    Object Relational databases combine the features of both relational databases and object-oriented programming. This means that when developing these databases, you ...

Related Ads

Featured