Content deleted Content added
Removed "can someone explain why this is" from the text of the article. Such comments are for discussion pages. |
|||
Line 28:
A '''final [[variable]]''' is [[immutable]]. It can only be assigned to one value. If the variable is a field of a class, it must be assigned to in the constructor of its class. (Note: If the variable is a reference, this means that the variable cannot be re-bound to reference another object. But the object that it references is still mutable if it was originally mutable.)
Unlike the value of a [[constant (computer science)|constant]], the value of a final variable is not necessarily known at compile time.
Example:
|