Here is a code sample:
class Program
{
static void Main(string[] args)
{
var obj = new DerivedClass();
obj.SomeMethod(5);
}
}
class
What I understand is that, since overriding/hiding is not applied, method of derived class is called as it is instantiated in main().
In Method Overriding: Base class reference variable pointing to child class object will invoke the overridden method in child class. “Override” keyword is used in derived class method signature.
In Method Hiding: Base class reference variable pointing to child class object will invoke the hidden method in base class. “New” keyword is used in derived class method signature.