public void run(){
System.out.println(Thread.currentThread()==this);
}
public static void main(String[] args){
test the=new test();
the.run();
the.start();
}
}
...全文
321418打赏收藏
启动线程是用run()方法还是start()方法?一样吗?
下面代码的运行结果是什么? public test extends Thread{ public void run(){ System.out.println(Thread.currentThread()==this); } public static void main(String[] args){ test the=new test(); the.run(); the.start(); } }