the following code in eclipse gives a “}” missing in classbody when in eclipse, but compiles perfectly well from the terminal. Any clues?
package quiz;
public class Session {
static int currentQuestion = 0;
private Sentence[] sentences; // for building questions
private Question[] questions;
public void generateReport(Session publishSession) {
}
public int getRightQuestionCount() {
}
public int getWrongQuestionCount() {
}
public int calculatePercent() {
}
public Question getQuestionAtIdx(int index) {
return questions[index];
}
public Question getPreviousQuestion() {
return getQuestionAtIdx(--currentQuestion);
}
public Question getNextQuestion() {
return getQuestionAtIdx(--currentQuestion);
}
public void setQuestionAtIdx(int index, Question) {
}
}
Toward the end, you’re declaring a function with two parameters; for the second parameter you specified the type, but no name. Maybe that’s it.