A virtual method is a method that can be redefined in derived classes. A virtual method has an implementation in a base class as well as derived class. When a virtual method is invoked, the run-time type of the object is checked for an overriding member.
- By default, methods are non-virtual. We can’t override a non-virtual method.
- We can’t use the virtual modifier with the static, abstract, private or override modifiers.