Game Development Reference
In-Depth Information
An example static method declaration is shown next:
public static function getDefaultName():String {
return DEFAULT_NAME;
}
Important to note here is that static methods may access their own class properties,
provided they are also static.
Accessing static properties and methods from outside the class requires specifying
the class name instead of the variable (instance) of a class.
For example:
Avatar.DEFAULT_NAME;
Vehicle.MAX_SPEED;
 
Search WWH ::




Custom Search