📄 newthread.java
字号:
//ExpandThreadDemo.NewThread.javaimport java.lang.*;import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class NewThread extends Thread implements Runnable{ private Thread t; public NewThread() { super("Demo Thread"); System.out.println("Child Thread: " + this); start(); } public void run() { try{ for(int i = 7;i > 0;i--) { System.out.println("Child Thread:" + i); Thread.sleep(500); } }catch(InterruptedException e){ System.out.println("Child interrputed."); } System.out.println("Exiting child thread."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -