爲什麼不能編譯這個類?我的班級定義有什麼問題?
class Exam {
private int score;
// constructor initializes score to 99
public void Exam() {
score = 99;
}
// returns the current value of score
private int getScore() {
return score;
}
// returns the String representation of the Object
public String toString() {
return "The score is " + getScore();
}
}
什麼錯誤信息你好嗎? – 2011-12-14 21:33:35
爲什麼不與我們分享編譯器的錯誤信息? – Codo 2011-12-14 21:34:17