J
John
I am writing a test system in Java.
According to my current design, True/False question is a sub class of
multiple choice question.
I have a problem here:
Multiple choice's constructor looks like this:
public multipleChoiceQuestion(boolean isQuiz)
{
choice=new choices();
setChoicesDone=false;
answer=new answers();
System.out.print("You have choosen to enter an multiple choice
question.Please enter the question below.\nPlease type here:>");
}
True False's like this:
public trueFalseQuestion(boolean isQuiz)
{
super(isQuiz);
choice=new choices("True", "False");
System.out.print("You have choosen to enter an true false question.Please
enter the question below.\nPlease type here:>");
}
The problem is that when the true false question is initalized the two print
out all show on the screen like this:
You have choosen to enter an multiple choice question.Please enter the
question below.
Please type here:>You have choosen to enter an true false question.Please
enter the question below.
Please type here:>
How can I disable the first one for multiple choice? Perhap I can let the
super() redirected to NULL?
According to my current design, True/False question is a sub class of
multiple choice question.
I have a problem here:
Multiple choice's constructor looks like this:
public multipleChoiceQuestion(boolean isQuiz)
{
choice=new choices();
setChoicesDone=false;
answer=new answers();
System.out.print("You have choosen to enter an multiple choice
question.Please enter the question below.\nPlease type here:>");
}
True False's like this:
public trueFalseQuestion(boolean isQuiz)
{
super(isQuiz);
choice=new choices("True", "False");
System.out.print("You have choosen to enter an true false question.Please
enter the question below.\nPlease type here:>");
}
The problem is that when the true false question is initalized the two print
out all show on the screen like this:
You have choosen to enter an multiple choice question.Please enter the
question below.
Please type here:>You have choosen to enter an true false question.Please
enter the question below.
Please type here:>
How can I disable the first one for multiple choice? Perhap I can let the
super() redirected to NULL?