下面代码展示了传统创建线程的2种方式,如果能正确推测出程序的执行结果,说明你对JAVA线程的创建过程和继承有不错的理解。
public class threadTest {
public static void main(String[] args) {new Thread(
new Runnable(){
public void run() {
System.out.println("Runnable run");
}
}
){
public void run(){
System.out.println("thread run");
}
}.start();
}
}