Content deleted Content added
rewrite, wikify |
m +link class |
||
Line 1:
In the [[Java programming language]], the <code>'''final'''</code> [[Keyword (computer)|keyword]] is used in several different contexts to define an entity which cannot later be changed.
A '''final [[Class (computer science)|class]]''' cannot be [[Subclass (computer science)|subclassed]]. This is done for reasons of security or efficiancy. Accordingly, many of the Java standard library classes are final, for example [http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html java.lang.System] and <code>[[java.lang.String]]</code>. All
A '''final [[Method (computer science)|method]]''' cannot be [[Method overriding (programming)|overridden]] by subclasses. This is done for reasons of efficiancy, since the method can then be placed [[Inline function|inline]] whereever it is called.
A '''final [[variable]]''' is a [[constant]]. It must be assigned a value at [[declaration]], and the variable can later be used but not assigned a new value. Local variables (for example, variables in loops) cannot be declared final.
|