Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Static Classes

Austin Lehman edited this page Oct 23, 2022 · 1 revision

Static classes implement the singleton design pattern where there is only a single instance of a specific class. The class is instantiated when it is included and is referenced by it's name after that. A few examples of static classes are the sys and console modules.

// Static class definition.
static class myClass {
	public myStaticFunct() {
		// ... do something
	}
}

// To use
myClass.myStaticFunct();		// We do not use the new operator to instantiate.

Clone this wiki locally