gudia wrote
to practise for my exam relating to
static,abstract,overloading,overriding.can smbody help plz
import java.util.HashSet;
import java.util.Set;
public class Exam {
private static final String ExamHeader = "Exam";
public static void main(String[] args) {
StringBuffer exam = new StringBuffer();
}
public static abstract class AbstractQuestion {
public abstract String getQuestion();
}
public static final class MultipleChoiceQuestion
extends AbstractQuestion {
public static final Set<String> defaultChoices;
static {
defaultChoices = new HashSet<String>();
defaultChoices.add("Yes");
defaultChoices.add("No");
defaultChoices.add("All of the above.");
}
public String getQuestion() {
return null;
}
public String getQuestion(int choiceCount) {
return null;
}
public String toString() {
return super.toString();
}
}
}
Too complicated. Here's mine: