class Test{ static void method() { int value=10; } }
when 2 objects are been created for this class. There will only one copy of the method in the memory since the method is static. but here there is a local variable inside the static method so when there are 2 objects created Will there be 2 copies or 1 copy of the local variables in the memory ??? what will happen??
There will be 1 copy of the variable. The method may be synchronized to enable simultaneous access by more than one thread. [ January 25, 2006: Message edited by: karthi keyan ]
Blind are leading the blind. There will be exactly n instances of the variable where n is the number of times that the method exists on some thread's call stack. n may be 0, it may be 42. There is much literature on this topic.