Different computer language has different meaning of virtual functions.
In C#, the advantages of declare a method being virtual are:
- It is the default implementation. The derived classes do not need to write one if it is a desired behavior.
- If the function/method only provides partial implementation, the derived class may choose to override it with additional codes, while the default implementation is still available to be called by the override method.
- Or, the derived class may override the complete method as its specialized way to do the named operation.