Virtual class

From Wikipedia, the free encyclopedia

In object-oriented programming, a virtual class is an inner class that can be overridden by subclasses of the outer class.[1]

Virtual classes are inner classes of another outer class, which behave like virtual functions. This means they can be overridden in a subclass of the outer class, and 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.)

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

References

  1. ↑ "Virtual Classes". CaesarJ Programming Guide. Technische Universität Darmstadt. 2006-02-10. Retrieved 2007-07-30. 

External links

  • Ernst, Erik; Ostermann, Klaus & Cook, William R. (2006). "A Virtual Class Calculus" (PDF). University of Aarhus. Retrieved 2007-07-30. 


This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.