posted 22 years ago
A variable's scope is the region of a program within which the variable can be referred to by its simple name. Secondarily, scope also determines when the system creates and destroys memory for the variable. Scope is distinct from visibility, which applies only to member variables and determines whether the variable can be used from outside of the class within which it is declared.
Final variables are the one you define once and cannot change it later. A final variable cannot change from its initialized value. Final variables are similar to constants in other programming languages. It's a compile-time error if your program ever tries to change a final variable.
A final variable is a member of a class or an object. It is declared within a class but outside of any method or constructor. It's scope is the entire declaration of the class.
Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD