我在我的代碼中得到「字符串不能解析爲類型」錯誤。字符串不能解析爲一個類型
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
FormLetter template;
template = new FormLetter();
template.print();
template.composeFormLetter(Sean, Colbert, God);
template.print();
}
}
class FormLetter
{
public void print(){
System.out.println(to + candidate + from);
}
public void composeFormLetter(string t, string c, string f){
to = t;
candidate = c;
from = f;
}
private string to;
private string candidate;
private string from;
}
爲了將來的參考,請務必在您的問題中發佈整個編譯器錯誤消息(如果存在),以便更容易查明錯誤。 – 2010-10-07 00:16:39