|
|
Keywords:
Instantiated,
Keyword,
Instance,
Variable,
Class
Keyword indicating that a variable is to be shared among all instances of a class.
a variable or method that exists on the class, rather than the instance of a class
A variable that is stored in a reserved area of RAM instead of in the stack. The area reserved cannot be used by other variables.
Something that is done or known at compile time. As a keyword applied to a local variable it requires that the compiler allocate storage (memory) at an address that will remain fixed to that variable throughout each execution of the program. Note that this is not the case for other local variables, which are assigned storage just for the duration of each execution of the block in which they are defined. Note that there are other uses of static but they are not used in this book.
A modifier to an Attribute to indicate that there's only one copy of the Attribute shared among all instances of the Classifier. A modifier to an Operation to indicate that the Operation stands on its own and doesn't operate on one specific instance of the Classifier.
A class or method declared as static exists without first being instantiated using the keyword new. Main() is a static method. For more information, see Static Classes and Static Class Members.
indicates there is to be exactly one copy of the variable or object named. Even if it's a field in a class, as many objects as are ever instantiated of that class, there will still only be one such field.
A Java keyword used to define a variable as a class variable. Classes maintain one copy of class variables regardless of how many instances exist of that class. static can also be used to define a method as a class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variables.
Static is a keyword that can be used on an element or method to denote that it is part of the class as a whole rather than just an instance of that class. Any element which is denoted as static is therefore constant over all instances of that class and can also be accessed without first creating an instance of that class. The same goes for static methods.
A keyword used for defining the scope and linkage of variables and functions. For internal variables, the variable has block scope and retains its value between function calls. For external values, the variable has file scope and retains its value within the source file. For class variables, the variable is shared by all objects of the class and retains its value within the entire program.
variable or method is shared between class instances
The static keyword is a modifier applied to method and variable declarations within a class. A static variable is also known as a class variable as opposed to non- static instance variables. While each instance of a class has a full set of its own instance variables, there is only one copy of each static class variable, regardless of the number of instances of the class (perhaps zero) that are created. static variables may be accessed by class name or through an instance. Non- static variables can be accessed only through an instance.
|