package a;
public class a {
public static void main(String[] args) {
// TODO Auto-generated method stub
b peothread=new b();
new Thread(peothread,"第一个人").start();
new Thread(peothread,"第二个人").start();
new Thread(peothread,"第三个人").start();
new Thread(peothread,"第四个人").start();
new Thread(peothread,"第五个人").start();
new Thread(peothread,"第六个人").start();
new Thread(peothread,"第七个人").start();
new Thread(peothread,"第八个人").start();
new Thread(peothread,"第九个人").start();
new Thread(peothread,"第十个人").start();
//new Thread(peothread,"第一个人");
}
}
package a;
public class b extends Thread {
private int woor=1;
public void run()
{
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName()+"通过了山洞!!!");
}
}
public class a {
public static void main(String[] args) {
// TODO Auto-generated method stub
b peothread=new b();
new Thread(peothread,"第一个人").start();
new Thread(peothread,"第二个人").start();
new Thread(peothread,"第三个人").start();
new Thread(peothread,"第四个人").start();
new Thread(peothread,"第五个人").start();
new Thread(peothread,"第六个人").start();
new Thread(peothread,"第七个人").start();
new Thread(peothread,"第八个人").start();
new Thread(peothread,"第九个人").start();
new Thread(peothread,"第十个人").start();
//new Thread(peothread,"第一个人");
}
}
package a;
public class b extends Thread {
private int woor=1;
public void run()
{
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName()+"通过了山洞!!!");
}
}