📄 firstrunnable.java
字号:
/** A simple class which demonstrates implementing interface Runnable. 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 FirstRunnable implements Runnable
{
int count = 0;
static volatile boolean running = true;
public FirstRunnable()
{
Thread t = new Thread(this);
t.start();
}
public void run()
{
while (running)
count++;
System.out.println("count is: " + count);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -