Using 'super' keyword
Thesuper keyword refers to the superclass (parent) objects.Uses:
class Animal { // Superclass (parent)
public void animalSound() {
System.out.println("The animal makes a sound");
}
}class Dog extends Animal { // Subclass (child)
public void animalSound() {
super.animalSound(); // Call the superclass method
System.out.println("The dog says: bow wow");
}
}