What is the difference between shadowing and overriding? | Eklavya Online

What is the difference between shadowing and overriding?

Shadowing is used to provide a new implementation for the base class method and helps protect against subsequent base class modification. Overriding allows you to rewrite a base class function with a different definition and achieve polymorphism.