当我使用函数 generatecode() 时,它引用了一个错误,我想看看我是否正确地进行了拆分。我是新手,仍然需要一些帮助。在这种情况下,我通过以下方式创建了一个新类:TestFile variable = new TestFile(); 我不知道这意味着什么。谢谢!
public class TestFile {
String[] preps = {
"about", "above", "across", "after", "against",
"along", "among", "around", "at", "before",
"behind", "below", "beneath", "beside", "between",
"by", "concerning", "down", "during", "except",
"for", "from", "in", "inside", "into",
"like", "near", "of", "onto", "out",
"over", "through", "to", "toward", "under",
"up", "upon", "with", "within", "without"
};
String[] errorpreps = {
"will", "would", "shall", "should", "can",
"could", "may", "might", "must",
};
String[] question = {
};
public static void main(String[] args) {
generatecode("hi");
};
public generatecode(String code){
String prep = "";
for (int i=0; i<preps.length; i++){
prep = prep + preps[i];
}
System.out.println(prep);
return prep;
}
public String printcode(String code){
return "";
}
}