You cannot use the static modifier inside a method. Not static variables, not static (local) inner classes, no static anything inside a method.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Aug 26, 2001
why is this? is it because of the method's life span? what i mean is if the method is destroyed after use, but a variable local to it is declared as static then the compiler throws an error? i guess i am not getting why this matters with methods, even though i understand it from a scope point of view. thank you marilyn.
Anything "static" is initialized first by the compiler. Static members are available a) class wide and B) before instantiation of an object derived from the class Methods are inherently temporary and local in scope. Temporary because variables used in methods are destroyed as soon as the method has done it's work. Anything "static" can also be called "un-changing and available classwide". HTH Pete ------------------ PAS firstname.lastname@example.org 2b | | !2b