Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 788 Bytes

i.8.4.4-virtual-methods.md

File metadata and controls

3 lines (2 loc) · 788 Bytes

I.8.4.4 Virtual methods

An object type can declare any of its methods as virtual. Unlike other methods, each exact type that implements the type can provide its own implementation of a virtual method. A virtual method can be invoked through the ordinary method call mechanism that uses the static type, method name, and types of parameters to choose an implementation, in which case, the this pointer can be null. In addition, however, a virtual method can be invoked by a special mechanism (a virtual call) that chooses the implementation based on the dynamically detected type of the instance used to make the virtual call rather than the type statically known at compile time. Virtual methods can be marked final (see §I.8.10.2).