This Code may help you what you want to tell.
package serilazation;
public class StaticLocal extends Thread{
static void localStaticVariables(){
int j = 0;
j++;
System.out.println(Thread.currentThread().getName() + " : Valude : " + j);
}
public static void main(
String[] args) throws Exception{
Thread b1 = new StaticLocal(){
@Override
public void run() {
while(true)
localStaticVariables();
}
};
Thread b2 = new StaticLocal(){
public void run() {
while(true)
localStaticVariables();
}
};
Thread b3 = new StaticLocal(){
public void run() {
while(true)
localStaticVariables();
}
};
b1.setName("b1");
b2.setName("b2");
b3.setName("b3");
b1.start();
b2.start();
b3.start();
Thread.currentThread().sleep(Long.MAX_VALUE);
}
}
Here each localStaticVariables method is static and having j as local variable. output is.
b2 : Valude : 1
b1 : Valude : 1
b3 : Valude : 1
b2 : Valude : 1
b1 : Valude : 1
which shows that each Thread is create new copy of local variable each time it not makes any difference for static method.. ya if you take this j as member variable then as per ilan Sutaria case will be different.. might this example will clear you drought very clary