📄 firstthread.java
字号:
/** A simple class which demonstrates extending Thread. The class simply increments
an instance variable until a flag is turned off. The value of the
instance variable is then displayed to the console. */
public class FirstThread extends Thread
{
int count = 0;
static volatile boolean running = true; // shared by all instances of the class
public void run()
{
while (running)
count++;
System.out.println("count is: " + count);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -