- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is runtime polymorphism or dynamic method overloading?
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object. Method overriding by a subclass is termed as runtime polymorphism. JVM determines the method to be executed at runtime instead of compile time.
example
class SuperClass { SuperClass get(){ System.out.println("SuperClass"); return this; } } public class Tester extends SuperClass { Tester get(){ System.out.println("SubClass"); return this; } public static void main(String[] args) { SuperClass tester = new Tester(); tester.get(); } }
Output
SubClass
- Related Articles
- Dynamic method dispatch or Runtime polymorphism in Java
- What is Dynamic Polymorphism in C#?
- What is the difference between compile time polymorphism and runtime polymorphism in java?
- Runtime Polymorphism in Java
- What is overriding and overloading under polymorphism in java?
- Difference between compile-time polymorphism and runtime polymorphism
- What is the difference between static and dynamic polymorphism?
- Java Runtime Polymorphism with multilevel inheritance
- Virtual Functions and Runtime Polymorphism in C++
- What is method overloading in Java?
- What is method overloading in C#?
- What is method overloading in PHP?
- What is the difference between method overloading and method hiding in Java?
- What is polymorphism in C# ?
- Method overloading in Java

Advertisements