Back to the 2026 paper

Module 3: Methods of Java

20267m

Write a short note on Runtime Polymorphism.

Worked SolutionAI Assisted

Runtime polymorphism

Runtime polymorphism allows a superclass reference to invoke a subclass's overridden instance method. The method implementation is chosen at runtime using dynamic method dispatch.

class Shape { void draw() { System.out.println("Shape"); } }
class Circle extends Shape { @Override void draw() { System.out.println("Circle"); } }
Shape s = new Circle();
s.draw(); // Circle

Benefits include extensibility, loose coupling and writing code against abstractions. Static, private and final methods are not overridden in the normal runtime-dispatch sense.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.