1.1线程优先级范围
最小为1
最大为10
1.2 线程默认的优先级
默认为5
1.3 优先级高的并不一定是最先执行的,最终由cpu调用,但是大多数是优先级高的先执行
1.4 先设置优先级,再执行start启动线程
1.5 如果优先级不在范围内,则抛出异常IllegalArgumentException
定义线程优先级源码:
/**
* The minimum priority that a thread can have.
*/
public final static int MIN_PRIORITY = 1;
/**
* The default priority that is assigned to a thread.
*/
public final static int NORM_PRIORITY <