java method overriding

Java
// Base Class 
class Parent { 
    void show(){ 
        System.out.println("Parent's show()"); 
    } 
} 
// Inherited Class 
class Child extends Parent { 
    // This method overrides show() of Parent Class
    @Override
    void show(){ 
        System.out.println("Child's show()"); 
    } 
}
// Main class 
class Main { 
    public static void main(String[] args){ 
        Parent obj = new Child(); 
		// Calling Child Class Method
        obj.show(); 
    } 
}
Source

Also in Java: