example9_8.java
来自「《Java程序设计与应用》-张仕斌-源程序 《Java程序设计与应用》-张仕斌」· Java 代码 · 共 40 行
JAVA
40 行
/*
* Example9_8.java
*
* Created on 2006年10月19日, 上午11:57
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package example9_8;
/**
*
* @author Administrator
*/
public class Example9_8 implements Runnable{
/** Creates a new instance of Example9_8 */
public Example9_8() {
}
public void run(){
System.out.println("My Name is "+Thread.currentThread().getName());
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Thread t1=new Thread(new Example9_8());
Thread t2=new Thread(new Example9_8());
Thread t3=new Thread(new Example9_8());
t2.setPriority(Thread.MAX_PRIORITY);//赋予最高优先级
t1.start();t2.start();t3.start();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?