多线程的问题
class SubThread extends Thread {
public SubThread(String name)
{
super(name);
}
public void run()
{
for(int i = 0; i < 3; i++)
{
System.out.println(Thread.getcurrentThread().getName() + "--" + i);
}
try {Thread.sleep(500);}
catch(Exception e) {}
}
}
public class MainThread
{
public static void main(String[] args)
{
for(int i=0; i < 3; i++)
{
SubThread s=new SubThread();
s.start();
}
}
}
不知道为什么编译不出来 为什么错?