首先感谢hockpink的回复! 错误基本上也解决了,基本上是以上你说的, classpath 的问题! 随便问一个问题: 在一个LinkedList容器dictinary(装的是string)中找字母c开头的string 我用的是以下方法,总感觉特别别扭(相对c++来说),而且执行的时间太长,有没有更好的方法? public String getWord(char c){ char temp[]={c}; String ss=new String(temp);//?have another mether to //convert a char to a string? int size=dictinary.indexOf(ss.toUpperCase());//我想这个c应该是字母了 return (String)dictinary.get(size+1); }
出现以上错误了?怎么回事?
第二,看看那个路径下面是不是真的有一个Dict.class
如果都没有问题,那么在运行一遍,把错误帖上来,我感觉你贴出来的错误很奇怪,那个dic很莫名其妙,或者你运行的时候写的文件名就不对,运行的时候文件名要区分大小写
错误基本上也解决了,基本上是以上你说的, classpath 的问题!
随便问一个问题:
在一个LinkedList容器dictinary(装的是string)中找字母c开头的string
我用的是以下方法,总感觉特别别扭(相对c++来说),而且执行的时间太长,有没有更好的方法?
public String getWord(char c){
char temp[]={c};
String ss=new String(temp);//?have another mether to
//convert a char to a string? int size=dictinary.indexOf(ss.toUpperCase());//我想这个c应该是字母了
return (String)dictinary.get(size+1); }