读书人

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

发布时间: 2012-01-31 21:28:41 作者: rapoo

报错“需要.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);

读书人网 >Java相关

热点推荐