Java View all facts Glossary Help |
syntactic unit > access unit > variable > constant > constant local variable |
constant local variable | ||||
subject | fact |
constant local variable | is a subtopic of Constants | |
is allowed in Java 1.1 and later | ||
is not allowed in Java 1.0 | ||
is a kind of constant | ||
is a kind of local variable | ||
constant | can be referenced without the existence of an instance of a class | |
has lifetime longer than the existence of an instance of the class | ||
has name a constant name | ||
to declare you use the 'final' keyword | ||
local variable | can be declared anywhere in a method | |
can be initialized by an assignment statement | ||
has a lifetime which is the time of one execution of its block | ||
variable | can be accessed by other variables and methods in any class in the same package by default | |
can contain different classes of objects depending on the type of the variable | ||
can contain only values that are of the same type as the variable or a subtype of the variable's type | ||
can refer to a particular object, several different objects during the execution of a program, or no object at all | ||
has purpose to refer to an object or a class or a primitive datum | ||
has scope | ||
has part value | ||
is declared by giving the data type followed by the name of the variable | ||
is destroyed in the block where it is declared | ||
may have access modifier | ||
refers to a class or an object or a primitive datum | ||
should be as private as possible | ||
access unit | has access mode | |
syntactic unit | has syntax rule bold = mandatory |
Next constant: constant that is declared in an interface Up: constant, local variable Previous constant: string constant