Method Overriding in Java | Core Java Training

This Core Java Training “Method overriding in Java” page explains clearly what is method overriding in Parent-Child relation and importance of method overriding in java application.


 

Method Overriding:

  • Defining a method in the Child class with the same name and same signature of it’s Parent class.
  • Overriding is the concept of Updating Parent’s functionality into Child.

 

Inheritance includes….

  1. Accessing existing object functionality.
  2. Adding new features.
  3. Updating(override) existing object functionality.

 

The following example explains clearly, when we use method overriding:

 

JVM invokes always updated(overridden) functionality in the application:

 

Share this