Imagine you have some code that you want to extend by a new feature:
void DoSomething()
{
// ...
NewMethod();
}
Now you introduce a new member called NewMethod
. However you don´t have the time to implement it appropriately and leave it empty:
public void NewMethod() { }
Some time later you can finally implement the code of that member without having to bother where and how to call it, because that was already done before.
You can also create an interface which you don´t implement. This way you only define what to do, but not how.
Another possible scenario is to have a virtual
member that usually does nothing, but in a few cases (some specific implementation) you want the method to return a specific value. See this post for example: Virtual methods without body