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

📄 mainthread.java

📁 JAVA程序设计课程中各章节的程序实例。
💻 JAVA
字号:
//Controling the main thread
class mainThread
{
	public static void main(String args[])
	{
		Thread t = Thread.currentThread();
		System.out.println("Current thread " + t);
		t.setName("My thread");
		System.out.println("After change " + t);
		try
		{
			for(int a=5; a>0; --a)
			{
				System.out.println(a);
				Thread.sleep(1000);
			}
		}
		catch(InterruptedException e)
		{
			System.out.println("Main thread interrupted");
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -