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

📄 testthread.java

📁 该文件在eclipse环境上运行
💻 JAVA
字号:
package test.thread;

public class TestThread{

	public static void main(String[] args) {
		Thread t = new MyThread();
		t.start();
		t = new Thread(new MyThread2());
		t.start();
		for(int i=1; i<27; i++){
			System.out.print(Thread.currentThread());
			System.out.println("----" + i);
		}
		
	}
}
class MyThread extends Thread{
	public void run(){
		for(char c='a'; c<='z'; c++){
			System.out.print(Thread.currentThread());
			System.out.println("----" + c);
		}
	}
}
class MyThread2 implements Runnable{
	public void run() {
		for(char c='A'; c<='Z'; c++){
			System.out.print(Thread.currentThread());
			System.out.println("----" + c);
		}
	}
}

⌨️ 快捷键说明

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