Java多线程编程总结(7)
时间:2026-01-19
时间:2026-01-19
多线程 java
* Company: Lavasoft( [url]/[/url])
* Author: leizhimin
* Modifier: leizhimin
* Date Time: 2007-5-17 10:03:12
* Readme: 通过扩展Thread类实现多线程
*/
public class TestMitiThread {
public static void main(String[] rags) {
System.out.println(Thread.currentThread().getName() + " 线程运行开始!"); new MitiSay("A").start();
new MitiSay("B").start();
System.out.println(Thread.currentThread().getName() + " 线程运行结束!"); }
}
class MitiSay extends Thread {
public MitiSay(String threadName) {
super(threadName);
}
public void run() {
System.out.println(getName() + " 线程运行开始!");
下一篇:应用办公软件-试卷(含答案)