📄 quiz.java
字号:
package quiz;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map;
import java.util.TreeMap;
public class Quiz {
private String name;
private Map questions = new TreeMap();
public Quiz(String name) {
this.name = name;
}
/**
* Returns the name of the quiz.
* @return
*/
public String getName() {
return name;
}
/**
* @param titel
* @param text
* @param order
* @return
*/
public Question createQuestion(String titel, String text, int order) {
Question q = new Question(titel, text, order);
questions.put(titel, q);
return q;
}
/**
* @return
*/
public Collection getQuestions() {
LinkedList ld = new LinkedList(questions.values());
Collections.sort(ld);
return ld;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -