本帖最后由 Cheers_for_CRAZ 于 2013-10-30 22:12 编辑
为什么运行下面的run方法,而不运行runnable接口中的run方法!哪位大神给个详细的解释!
public class ThreadTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
new Thread(new Runnable(){
public void run(){
for (int i = 0; i <50; i++) {
System.out.println(Thread.currentThread().getName());
}
}
}){
public void run(){
for (int i = 0; i <50; i++) {
System.out.println("....."+Thread.currentThread().getName());
}
}
}.start();
}
}
|