哪里出错了?求教!
class kothread extends Thread
{
int n;
String st;
public kothread(String ko)
{
st=ko;
}
public void run()
{
for(n=0;n<6;n++)
{
try
{
System.out.print(st);
Thread.sleep(250);
}
catch(InterruptedException e)
{
System.out.println("Exception:"+e.getMessage());
}
}
}
}
public class ko3
{
public static void main(String args[])
{
kothread ko1=new kothread("A");
kothread ko2=new kothread("B");
ko1.start();
ko2.start();
}
}
报错:
Exception in thread "main" java.lang.NoSuchMethodError: kothread.start()V
at ko3.main(ko3.java:34)