当前位置: 代码迷 >> Java相关 >> 报错“需要.class”!新手、求高手给解!该如何解决
  详细解决方案

报错“需要.class”!新手、求高手给解!该如何解决

热度:5633   发布时间:2013-02-25 21:51:54.0
报错“需要.class”!新手、求高手给解!
public static void main(String[] args)
{ String[] words={"hate","the","cat"};
int len=words.length;
select(words[]); //需要.class
System.out.println(words);
}

static void select(String[] lesswords)
{
int newlen=lesswords.getlength;
for(int i=0;i<newlen;i++)
{
String[] newwords=new String();
int k;
for(k=0;k<newlen;k++)
{
if(k!=i)
newwords[k]=lesswords[k];
}
System.out.print(lesswords[i]);
select(newwords[]); //需要.class
}
}

------解决方案--------------------------------------------------------
select(words[]);

要改为: select(words);
  相关解决方案