?? thread1.java
字號:
package com.resource;
public class Thread1 extends Thread {
String s;
int i;
public Thread1(String s,int i){this.s=s;this.i=i;}
public void run(){
int count=0;
try{
while (true)
{
System.out.print(this.s+" ");
sleep(this.i);
count++;
if (count>10) break;
}
System.out.println("Thread"+this.s+"finish running");
}catch(InterruptedException e){System.out.println("Interrupted Exception");}
catch(IllegalMonitorStateException e){System.out.println("Illegal Monitor State Exception");}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -