Unified Modeling Language Reference Manual, The, Second Edition
by James Rumbaugh, Ivar Jacobson, Grady Booch
class attribute
An attribute whose value is shared by all instances of a class. Also called static feature.
Semantics
A class attribute (or static attribute, for C++ or Java users) is an attribute for which one slot is shared by all instances of a class (but not part of any one of them specifically). Such an attribute is therefore not a property of an instance at all but rather a property of the class. Access to a class attribute does not require an instance, although some programming languages provide a syntax that uses an instance for convenience. For most purposes, a class attribute is a global variable in the namespace of a class.
A default value for a class attribute represents the value of the attribute when the class itself is initialized. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access