Day 12-Difference Between method overriding and method hiding
- In Method Overriding a base class reference variable pointing to a child class object ,will invoke the overridden method . In Method hiding base class reference variable pointing to a child class object ,will invoke the hidden method
- For hiding the base class method from derived class simply declare the derived class method with the new keyword.
Whereas in C#, for overriding the base class method in a derived class, you need to declare the base class method as virtual and the derived class method as overridden .