Blair, Tomm and David,
Thank you for the reply.
I am much impressed your comprehensive knowledge.

Let me summarize to check whether I  took it correctly.

I was wrong on the assumption that the variable within
the static method is one and only and used everywhere,
just like the method itself.  Isn't it?

I thought a static method craves no memory of its own, even for its variables,
for sometimes static methods are called with Class names instead of
instance names and seems to have no instances at all, as David mentioned...

I did not fully understand about stack thing, but I understood
a static method will assign memory for its "automatic" variables
(variables declared in the method) every time the method is
called anew and release these memory the method was terminated.
So each call of the method has automatic variables independently.

Assign memory to the automatic variable by every call is essential
to "reentrant" program and it does nothing with static or not.

Is my understanding OK this time?


Regards,
Emiko Kezuka



To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to