ITP

BCA - OOPS and Data Structures

Explain Runtime Polymorphism and compile time

In : BCA Subject : OOPS and Data Structures

In C++, polymorphism allows objects to behave differently even though they are accessed using the same function name. 

There are two types of polymorphism in C++: 

    Compile Time Polymorphism 
    Runtime Polymorphism

  1. Compile Time Polymorphism 

    Also called Early Binding  or Static Polymorphism  

        This type of polymorphism is resolved at compile time  — meaning the compiler already knows which function will be called. 

    By using: 

        Function Overloading 
        Operator Overloading
  2. Runtime Polymorphism 

    Also called Late Binding  or Dynamic Polymorphism  

        This type of polymorphism is resolved at runtime  — the actual object determines which function is called.

    By using: 

        Virtual Functions 
        Base class pointer/reference to derived class object

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap