Actions

::Virtual class

::concepts



{{#invoke:Hatnote|hatnote}} {{ safesubst:#invoke:Unsubst||$N=Context |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} In object-oriented programming, a virtual class is a nested inner class whose functions and member variables can be overridden and redefined by subclasses of the outer class.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Virtual classes are analogous to virtual functions.

The run time type of a virtual class depends on the run time type of an object of the outer class. (Just like the run time type of an object decides which virtual function should be used.)

A run time instance type of the outer class object not only decides on the polymorphic type of its own type object, but also on a whole family tree of virtual class members.


Virtual class sections
Intro   Purpose    Example   See also  References  External links  

PREVIOUS: IntroNEXT: Purpose
<<>>

Class::virtual    Virtual::classes    Object::parts    Inner::machine    Derived::wheels    Title::outer

{{#invoke:Hatnote|hatnote}} {{ safesubst:#invoke:Unsubst||$N=Context |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} In object-oriented programming, a virtual class is a nested inner class whose functions and member variables can be overridden and redefined by subclasses of the outer class.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Virtual classes are analogous to virtual functions.

The run time type of a virtual class depends on the run time type of an object of the outer class. (Just like the run time type of an object decides which virtual function should be used.)

A run time instance type of the outer class object not only decides on the polymorphic type of its own type object, but also on a whole family tree of virtual class members.


Virtual class sections
Intro   Purpose    Example   See also  References  External links  

PREVIOUS: IntroNEXT: Purpose
<<>>