answersLogoWhite

0


Best Answer

Runtime polymorphism is also called as method overriding, late binding or dynamic polymorphism. It is when a method in a subclass overrides a method in its super class with the same name and signature.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you meant by Runtime Polymorphism?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Types of polymorphism in oops?

two types are compiletime and runtime polyymorphism


What is the difference between compile time and run time polymorphism?

Runtime prolymorphism means overriding compiletile polymorphism means overloading


Why run time polymorphism is dynamic and compile time polymorphism is static?

The simple answer is that compile-time polymorphism occurs at compile time while runtime polymorphism occurs at runtime. The actual answer is that compile-time polymorphism results in the compiler generating source code on your behalf while runtime polymorphism relies on function pointers or virtual methods to determine the next instruction at runtime. Compile-time polymorphism therefore applies to template functions and classes since that is the only way the compiler can generate source code on your behalf. To achieve this, the runtime type for the template parameters must be fully-defined at compile time, even if those types have runtime polymorphic characteristics of their own. Runtime polymorphism applies to virtual methods and function pointers, both of which can be used to dynamically alter the execution path of your program. Virtual methods are made possible through virtual tables, which are essentially just arrays of function pointers. Each runtime type that derives from a base class with virtual methods provides its own virtual table, thus the runtime type determines which specific function overrides will be invoked at runtime, even if the runtime type cannot be determined at compile time. In this way you can generalise your code to work with the base type but still get the expected polymorphic behaviour whenever a derived type is passed instead.


What is Difference between dynamic polymorphism and static polymorphism with example?

Static polymorphism is used the concept of early binding or we can say compile time binding where as dynamic polymorphism used the concept of late binding or run time binding.


Is late binding and dynamic binding related to polymorphism?

Late binding and dynamic binding are related to runtime polymorphism. By contrast, compile time polymorphism is known as static binding. Template functions and classes are examples of static binding because the exact type can be determined at compile time.


What is the different between polymorphism and dynamic binding?

In computer science, polymorphism refers to a computer language's ability to process objects according to their data type. Dynamic binding on the other hand, is a mechanism wherein the method used on an object is being looked up by name at runtime.


What is dynamic method dispatch in java?

dynamic method dispatch is a technique by which a call to a overridden method is solved at runtime rather than compile time..this is how java implements runtime polymorphism.


Polymorphism in coelentrates?

polymorphism in coelentrates


How does virtual function support run time polymorphism?

Virtual functions are used to suport runtime polymorphism.In C++,if we have inheritance and we have overridden functions in the inherited classes,we can declare a base class pointer and make it to point to the objects of derived classes.When we give a keyword virtual to the base class functions,the compiler will no do static binding,so during runtime ,the base class pointer can be used to call the functions of the derived classes.Thus virtual functions support dynamic polymorphism.


Why do you need runtime polymorphismis inheritance necessary for it?

Runtime polymorphism is required because accessing the runtime type of an object is expensive. And yes, inheritance is required for it because polymorphism is enabled through virtual functions. It is not the programmer's responsibility to determine the runtime type of an object because that information should be provided by the object's own virtual table. Thus when you implicitly invoke a virtual method of the base class, you rightly expect most-derived method to be executed, even when you cannot know in advance the exact type of the derivative -- all you know is that it is a type of base class. And that's all you need for polymorphism to work. If you ever find yourself having to turn on the runtime type of an object in order to invoke one of its methods, then you need to seriously consider redesigning your classes. How can your code possibly cope with a runtime type it has no knowledge of, such as a derived object of a class created by a third-party? In those instances you would have no way of knowing what specific methods were available. But with virtual methods there is no need to know. You simply invoke the generic virtual methods of your base class and you automatically get specific behaviour; all your derivatives do whatever they've been implemented to do, whether it is to invoke the base class method explicitly, or provide an override, or indeed both!


What is polymorphism and its types?

Polymorphism means multiple form of a function, variable or object. In Computer Science, polymorphism is a programming language feature that allows values of different data types to be handles using a common interface. There are three types : Ad-Hoc Polymosphism, Parametric Polymorphism, Subtype/Inclusion Polymorphism. Source: Wikipedia.


What kind of drugs commonly has polymorphism?

Polymorphism is common with barbiturates, steroids, and sulphonamides.