Back to the 2026 paper

Module 3: Methods of Java

20262m

Runtime polymorphism in Java is primarily achieved through:

(i) Method overriding
(ii) Constructor overloading
(iii) Method overloading
(iv) Static variables

Worked SolutionAI Assisted

Answer: (i) Method overriding

Runtime polymorphism occurs when a superclass reference refers to a subclass object and an overridden instance method is selected according to the object's actual type at runtime.

class Animal { void sound() { System.out.println("sound"); } }
class Dog extends Animal { @Override void sound() { System.out.println("bark"); } }
Animal a = new Dog();
a.sound(); // bark

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.