posted 19 years ago
When Class definition is loaded all its static members get allocation of space and become available for use, When Method is declared as static, It is Available without the instance of Class, it was very basic, Now why local variables cant be static, possibly because with each static or non-static method execution, local vairables gets space allocation, Where as static means sharing across multiple instances, So can get an idea about why this restriction might have came, Continuing, If it is so why local variables can be final, possibily because here compiler can optimise few things as local final variable will only hold same values with each invocation i.e. Value when it is declared.
[ February 02, 2006: Message edited by: Vishal Angrish ]