Final (Java): Difference between revisions

Content deleted Content added
Line 33:
Unlike the value of a [[constant (computer science)|constant]], the value of a final variable is not necessarily known at compile time.
 
Instances of inner classes can access fields of the enclosing instance only if they are final. //CAN SOMEONE PLEASE ELABORATE ON WHY THIS IS? THANKS.
 
Example: