wrote:
> ZelluX wrote:
>
>> Why can't i declare a static variable in a static method?
>
> A local variable exists (or rather before eligible for GC) only for
> the scope of the method, so the concept of static is not relevant.
There's nothing wrong with the idea of a static local variable, which
would be a static variable whose scope was restricted to the block
(hence method) in which it is declared. (Naturally an initialiser
for such a variable would not be allowed to refer to non-static locals.)
It's just that Java doesn't have them: I have no idea why.
--
Chris "perhaps method calls generate friction => sparks?" Dollin
Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN