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

📄 examthread1.java

📁 JAVA程序设计 丁岳伟 彭敦陆编 高等教育出版社 第7---11章程序
💻 JAVA
字号:
//ExamThread1.java
import java.util.*; 
public class ExamThread1 extends Thread{
	String threadName; 
	public ExamThread1(String threadName){ 
		this.threadName=threadName;
		System.out.println(threadName+ "created!");
	} 
	public void run(){
		System.out.println(threadName+"started!");
		try { 
			Thread.sleep(1000); 
		}catch(Exception e){
			e.printStackTrace(); 
		} 
		System.out.println(threadName+" finished!");
	}
	public static void main(String args[]){ 
		ExamThread1 thread1 = new ExamThread1 ("first thread "); 
		thread1.start( );
		ExamThread1 thread2= new ExamThread1 ("second thread "); 
		thread2.start( );
		ExamThread1 thread3= new ExamThread1 ("third thread "); 
		thread3.start( );
	} 
} 

⌨️ 快捷键说明

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