📄 question.java
字号:
package fangsoft.testcenter.model;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Question implements java.io.Serializable {
private List choices;
private String text;
private String answer;
// private int counter;
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public Question() {
super();
text = "";
choices = new ArrayList();
// TODO Auto-generated constructor stub
}
public void addChoice(Choice aChoice) {
// choices[counter]=aChoice;
choices.add(aChoice);
}
public Choice getChoice(int index) {
// return choices[index];
if (index >= 0 && index < choices.size())
return (Choice) choices.get(index);
return null;
}
public int getCount() {
return choices.size();
}
/*
* protected void finalize() throws Throwable { System.out.println("Finalize
* called on " + this); super.finalize(); }
*/
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public List getChoices() {
return choices;
}
public void setChoices(List newchoices) {
this.choices = newchoices;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -