Java-多线程的实现与启动
class mythread extends Thread //多线程的启动
{
private String name;
public mythread(String name)
{
this.name=name;
}
public void run()
{
for(int i=0;i<10;i++)
{
System.out.println("线程"+name+"运行结果:"+i);
}
}
}
public class test58 {
public static void main(String args[])
{
mythread a=new mythread("A");
mythread b=new mythread("B");
a.start();
b.start();
}
}
补充:软件开发 , Java ,