你这是什么程序?
本身就是错的 ------------------------------------------------------
我们还年轻牛奶会有的奶牛也会有的
可天天在 csdn 混这些会有吗 ??
本身就是错的 ------------------------------------------------------
我们还年轻牛奶会有的奶牛也会有的
可天天在 csdn 混这些会有吗 ??
col = forlocation(); private String forlocation() { String[] locations = { "Where ", "How " }; } 报错提示是这样:incompatible types
found : java.lang.String
required: java.lang.String[]
col = forlocation(); 不知该如何解决?
col = forlocation(); private String forlocation() { String[] locations = { "Where ", "How " }; .....................} 报错提示是这样:incompatible types
found : java.lang.String
required: java.lang.String[]
col = forlocation(); 不知该如何解决?
{
col = forlocation(); }
private String forlocation() { String[] locations = { "Where ", "How " };
return locations[0];}
这才勉强通得过,但不知道你想做什么。
{
col = forlocation(); }
.....................
//另一个方法
private String forlocation() { String[] locations = { "Where ", "How " };
return locations[0];}
col = forlocation(); private String[] forlocation() { String[] locations = { "Where ", "How " };
return locations;
}
col = forlocation(); private String[] forlocation() { String[] locations = { "Where ", "How " };
return locations;
}这样 ------------------------------------------------------
我们还年轻牛奶会有的奶牛也会有的
可天天在 csdn 混这些会有吗 ??
col = forlocation(); private String[] forlocation() { String[] locations = { "Where ", "How " }; String[] actions = { " for ", " find ", " get " };......................String[][] sentence =
{ locations, actions, sources,
prepositions, subjects, endings };
}还是不行嘛
数组col可不指定长度,如方法forlocation返回数组长度大于30,程序肯定的死翘翘。
String[] col;
col = forlocation(); private String[] forlocation() {
String[] locations = { "Where ", "How " };
return locations;
}
String[] col= new String[30]; for(int i=0; i<col.length; i++) {
col = forlocation(); private String[] forlocation() {
~~~~~~~~String[] locations = { "Where ", "How " }; .....................}
found : java.lang.String
required: java.lang.String[]
col = forlocation();
String[] col;
col = forlocation(); private String[] forlocation() {
String[] locations = { "Where ", "How " };
return locations;String[][] sentence =
{ locations, actions, sources,
prepositions, subjects, endings };
}
return sentence.length;
}
col = forlocation();
private String[] forlocation() {
String[] locations = { "Where ", "How " };
String[] actions = { " for ", " find ", " get " };......................String[][] sentence =
{ locations, actions, sources,
prepositions, subjects, endings };
for(int i=0; i<sentence.length; i++) {
query = query + randomEntry(sentence);
}
return(query);
}
private String randomEntry(String[] strings) {
int index = (int)(Math.random()*strings.length);
return(strings[index]);
}
}