Overriding
class Parent {
public void display(String a) {
System.out.println("Inside child display accepting parameter " + 1);
}
}
public class Overriding extends Parent {
/* Overriding is the re definition of a function name with same signature. */
public void display(String a) {
System.out.println("Inside child display accepting parameter " + 1);
}
public static void main(String[] args) {
Overriding over = new Overriding();
over.display("HELLO WORLD..!!");
}
}
Output:
Inside child display accepting parameter 1