⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lx6_1.java

📁 针对越来越多的用户喜欢JAVA
💻 JAVA
字号:
public class Lx6_1
{
public static void main (String args[])
{
MyThread th[] =new MyThread[3];
for (int i=0; i<3; i++)
th[i] =new MyThread();
for (int i=0; i<3; i++ )
th[i].start();
th[0].setPriority(Thread. MAX_PRIORITY);
th[2].setPriority(Thread. MIN_PRIORITY);
}
}
class MyThread extends Thread
{
public void run()
{
for (int i=0; i<2; i++)
System.out.println(getName()+"线程的优先级是:\t"+getPriority()+"。");
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -