Home / Questions / What is method overriding?
Explanatory Question

What is method overriding?

👁 3 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Method overriding occurs when a subclass provides its own implementation of a parent class method.


class A {
    void show() { }
}

class B extends A {
    void show() { }
}

✅ Happens at runtime