Explain what is polymorphism in C++?

devquora
devquora

Posted On: Feb 22, 2018

 

Polymorphism is a kind of runtime generalization that is enabled by the type system in object-oriented as well as functional programming languages like C++ and Haskell. Typically, we talk about two types of polymorphism in programming languages:

  • Subtype polymorphism – which allows a function that is defined over a formal parameter having one type also to be defined over subtypes of same.
  • Parametric polymorphism – which allows a template, already defined class over a template parameter having one type also to be defined over subtypes of same.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..