📄 question.java
字号:
package qa;
public abstract class Question
{
private Answer answer;
private String questionText;
private Question hintQ;
protected Question()
{
}
protected Question(Answer a, String text)
{
answer = a;
questionText = text;
}
public void setAnswer(Answer a)
{
answer = a;
}
public Answer getAnswer()
{
return answer;
}
public void setQuestionText(String text)
{
questionText = text;
}
public String ask()
{
return questionText;
}
public void setHint(Question q) throws Exception
{
if (q.getAnswer() == hintQ.getAnswer())
{
throw new Exception();
}
else hintQ = q;
}
public String getHint()
{
return hintQ.ask();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -