?? people.java
字號:
package com.lovo.zengxy.util;
public class People implements Runnable {
//public class People extends Thread {
String name;
ClassQ classq;
Thread th;
public People(String name,ClassQ classq){
this.name = name;
this.classq = classq;
th= new Thread(this,name);
th.start();
}
public void run() {
while(true){
try {
classq.play(name);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
classq.rest();
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
/**
* @param args
*/
public static void main(String[] args) {
ClassQ classq = new ClassQ();
People p1 = new People("拳擊手A",classq);
People p2 = new People("拳擊手B",classq);
p1.th.setPriority(1);
p2.th.setPriority(10);
// p1.start();
// p2.start();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -