⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 firstthread.java

📁 国外的数据结构与算法分析用书
💻 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 + -