哪里出错了?求教!
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)
问题点数:20、回复次数:4Top
1 楼li_d_s(鄙视那些不懂Java却跑来乱骂的人,.NET没啥了不起)回复于 2006-03-09 17:02:03 得分 10
我拷贝下去编译运行,一点问题都没有啊,是不是jdk有问题啊Top
2 楼iriver103(至尊玉)回复于 2006-03-10 01:17:04 得分 10
对,没问题,应该是JDK环境有问题吧!Top
3 楼hancent(梨花剑君)回复于 2006-03-11 10:28:31 得分 0
运行别的是可以,就这个不行Top
4 楼cdzhou()回复于 2006-03-11 10:36:23 得分 0
看看你这个Thread类是不是java.lang.Thread?
不行就写个全名Top




