天天看點

3個for循環可以都被執行

//3個for循環可以都被執行

public class Demo {

public static void main(String[] args) {

//匿名内部類

new Thread(){

public void run() {

// TODO Auto-generated method stub

for(int x=0;x<100;x++){

System.out.println(Thread.currentThread().getName()+".........."+x);

}

}

}.start();

for(int y=0;y<100;y++){

System.out.println(Thread.currentThread().getName()+".........."+y);

}

Runnable r=new Runnable(){

public void run() {

for(int z=0;z<100;z++){

System.out.println(Thread.currentThread().getName()+".........."+z);

}

}

};

}