なぜこのクラスはコンパイルされませんか?私のクラス定義に何が問題なのですか?
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();
}
}
どのようなエラーメッセージが表示されますか? –
コンパイラのエラーメッセージを私たちと共有しないのはなぜですか? – Codo
@Codo:それはゲームです。 –