?? runabledemo.java
字號:
package runable.Thread;
public class RunableDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
RuableTest th=new RuableTest();
new Thread(th).start();
new Thread(th).start();
new Thread(th).start();
new Thread(th).start();
}
}
class RuableTest implements Runnable
{
private int tickets=100;
public void run()
{
while(true)
{
if(tickets>0)
System.out.println(Thread.currentThread().getName()+"is sailing tickets"+tickets--);
else
break;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -