This content has been marked as final. Show 2 replies
static members belong to the class, not to the instance(s),
the class with its (static) members lives in perm space (special kind of heap),
instances live on the regular heap
method local variables belong to the executing thread,
thread local variables are allocated on the stack,
thread local variables go out of scope when the method completes
Hi,In C, a static local variable is used to maintain state between function calls. In Java, the way to maintain state is with a member variable. We have no need of static local variables.
Why a local variable can not be declared as static?
What is the logic behind this static keyword?
The meaning of the static keyword is "associated with the class as a whole, rather than with any one instance."