Difference between revisions of "Gambas/syntax/variables/classes/virtual"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Gambas‎ | syntax‎ | variables‎ | classes
Jump to navigation Jump to search
m (Woozle moved page Gambas/virtual class to Gambas/syntax/variables/classes/virtual: reorganizing)
(corrections)
Line 1: Line 1:
==Overview==
+
==About==
In [[Gambas]], a [[virtual class (Gambas)|virtual class]] is a class containing one or more [[virtual method]]s, i.e. methods whose [[method interface|interface]] has been defined but whose [[method implementation|implementation]] has not been. This is similar to the usage of the term in other languages.
+
In [[Gambas]], a '''virtual class''' is a class containing one or more [[abstract method]]s (which Gambas calls "virtual methods"), i.e. methods whose [[method interface|interface]] has been defined but whose [[method implementation|implementation]] has not been.
  
In Gambas, virtual methods are always named beginning with a ".", e.g. ".ListViewItem".
+
Gambas virtual classes are always named beginning with a "." (e.g. ".ListViewItem") except when being invoked as the ancestor of another class (i.e. using the "{{l/sub|inherits|Gambas}}" keyword).
 
 
It is not quite clear from the documentation, but it appears that virtual methods can only be [[virtual class instantiation|instantiated]] using C++; see [[writing classes in Gambas]].{{seed}}
 

Revision as of 23:12, 9 May 2015

About

In Gambas, a virtual class is a class containing one or more abstract methods (which Gambas calls "virtual methods"), i.e. methods whose interface has been defined but whose implementation has not been.

Gambas virtual classes are always named beginning with a "." (e.g. ".ListViewItem") except when being invoked as the ancestor of another class (i.e. using the "inherits" keyword).