Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Static variable
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Object-oriented programming == {{Unreferenced section|date=June 2023}} In [[object-oriented programming]], there is also the concept of a ''[[static member variable]]'', which is a "[[class variable]]" of a statically defined class, i.e., a [[member variable]] of a given class which is shared across all [[class instance|instances]] (objects), and is accessible as a member variable of these objects. A class variable of a dynamically defined class, in languages where classes can be defined at run time, is allocated when the class is defined and is not static. Object constants known at compile-time, such as [[string literal]]s, are usually allocated statically. In object-oriented programming, the [[virtual method table]]s of classes are usually allocated statically. A statically defined value can also be [[Global variable|global]] in its scope ensuring the same [[Immutable object|immutable]] value is used throughout a run for consistency.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)