Demonstration should include writing code that accomplishes the override. The code below shows the method printAboutMe will be overridden by retaining the identical method declaration:
class SuperFive extends SuperFour{
/* Just one method in the SuperFive class and its job is to override the printAboutMe()
method from the super class*/
public void printAboutMe() {
System.out.println("Let’s not even print the value of a variable here, just say Hi!");
}
public static void main(String args[]) {
SuperFive objOfSuperFive = new SuperFive();
objOfSuperFive.printAboutMe();
}