黑马程序员技术交流社区
标题:
线程的优先级问题
[打印本页]
作者:
357016138
时间:
2014-7-28 18:02
标题:
线程的优先级问题
是不是主线程的优先级比下面的t线程优先级高?
复制代码
作者:
357016138
时间:
2014-7-28 18:04
public class ThreadTest {
public static void main(String args[]) {
MyThread t = new MyThread();
t.run();
t.start();
System.out.println("A");
}
}
class MyThread extends Thread {
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
}
System.out.println("B");
}
}
复制代码
作者:
masai158
时间:
2014-7-28 18:07
run 是调用方法吧。。。start 才是开启线程
作者:
乐此不疲
时间:
2014-7-28 19:44
不刻意设定的话都是默认的NORM_PRIORITY
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2