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
nova ✩ edited this page Jul 14, 2026
·
15 revisions
To interact with our classes so far we have needed to create an instance of it first. It's also possible to create methods and fields that are independent of any instance, similar to a global variable or function, using the static modifier.
classExample:publicstaticexampleField:numberpublicstaticexampleMethod():broadcast"i dont belong to any instance!"
To access a static field/method you need to refer to the class directly as they are not accessible from any particular instance.