You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2026. It is now read-only.
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.