package duoxiancheng;
class The extends Thread//继承Thread创建多线程
{
String s;
The(String s)//此构造函数是为了自定义线程名称
{
this.s=s;
}
public void run()//覆盖run方法
{
for(int i=0;i<=10;i++)
{
System.out.println(s+"...run");
}
}
}
public class TheadDemo1 {
public static void main(String [] args)
{
The t1=new The("one");
The t2=new The("two");
t1.start();
t2.start();
}
}