Get 50% Discount on Our Udemy Course to Memorize the Periodic Table in 30 minutes Click Here. COUPON CODE: ALCHEMY

How to remember the difference between Runtime polymorphism and Compile time polymorphism in Java?

0 votes
asked Dec 4, 2015 by nanospeck (6,620 points)

Often we might get confused by the following

Compiletime polymorphism class overloading in java
Runtime polymorphism class overriding in java

Both class overriding/overloading might get mixed up and can cause confusion.
What is an easy hack to remember this?

1 Answer

0 votes
answered Dec 4, 2015 by nanospeck (6,620 points)

The hack is to create a trick to remember only 'Runtime Polymorphism'. 
Here is simple piece of code about 'Bikes' relating to runtime polymorphism

class Bike {
public ride(){}

class HarleyDavidson extends Bike {
// Look!!! class-overriding below
public ride(){
System.out.println("Enable 6th gear");


Now here comes the trick.Runtime polymorphism can be imagined as something that always moves. Eg. our bike is a perfect example. You can ride it around. It's dynamic and it moves. 
So here 'ride' is the keyword.

Relate class-overriding with the method 'ride

The 'ride' method in the above example is an instance of class-overriding hence its very easy to remember now that Runtime Polymorpism is related with class-overriding

Related questions

0 votes
1 answer 444 views
0 votes
1 answer 812 views
0 votes
1 answer 6,648 views

Part-time Student Content Contributor / Blogger

Eligibility: 8th-12th Standard Students Only, India

Job Description is a unique educational startup for creating engaging learning content. We are looking for creative students who can post new learning tricks to the website on part-time basis.

Salary: 3000 INR per month

Location: Remote / Work from home


  • Create mnemonic or story bases answers to the questions posted in the website regularly
  • The answers should be creative, engaging and easy to recollect
  • Add new questions and interesting answers to the website regularly
  • Improve the overall user engagement and content quality of the website

Skills Required

  • Should have good imagination and creativity
  • Should have writing skill in English
  • Should dedicate minimum 4 hours / week
  • Having artistic skills like singing, cartoon drawing, acting etc are added bonus but not mandatory

How to Apply

Create a simple trick to learn any topic from any subject you like.

Checkout some examples at:

Email a short description about your self, details of your trick and contact number to:

The trick must be short, interesting and engaging and helps the reader to learn the topic very easily.

Tricks are preferred in text format but other forms like cartoons, drawings, songs or even TikTok videos are very much welcome.

Shortlisted candidates will be contacted for a short round of telephonic interview.