?? thread1.java
字號(hào):
package com.zhoutenghn;
import java.util.Date;
public class Thread1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Thread2 thread = new Thread2();
thread.start();
try {
Thread.sleep(10000);
thread.interrupt();
}catch(InterruptedException e){
}
}
}
class Thread2 extends Thread {
public void run(){
while (true){
System.out.println("時(shí)間為:"+new Date());
try {
sleep(1000);
}catch(InterruptedException e){
return;
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -