本帖最后由 孙沛 于 2012-9-4 19:50 编辑
package org.lxh.demo09; class MyThread_2 extends Thread{ private String name; public MyThread_2(String name) { this.name = name; } public void run(){ for(int i=0;i<10;i++) { System.out.println(name+"运行,i="+i); } } }
public class ThreadDemo02 { public static void main(String args){ MyThread_2 mt1 = new MyThread_2("线程A "); MyThread_2 mt2 = new MyThread_2("线程B "); mt1.start(); mt2.start(); } } 结果没有实现多线程 问题出现在哪?求解答...
|