?? certtest.java
字號:
package fangsoft.testcenter.model;
public class CertTest extends Test {
public CertTest() {
// TODO Auto-generated constructor stub
super();
}
public CertTest(String aText) {
super(aText);
// TODO Auto-generated constructor stub
}
public boolean generate() {
// TODO Auto-generated method stub
String[] qinit = {
"Platform independence means:",
"*Not tied to one hardware or software architecture",
"Needs no platform",
"Difficult to control on a platform",
"Nothing, just a fancy term OO developers are using",
null,
"Which is the correct syntax for a main method?",
"public static main(String[] args)",
"public static void main(String args)",
"public main(String[] args)",
"*public static void main(String[] args)",
null,
"Which is the correct syntax for a main method?",
"public static main(String[] args)",
"public static void main(String args)",
"public main(String[] args)",
"*public static void main(String[] args)",
null,
"Which is the correct syntax for a main method?",
"public static main(String[] args)",
"public static void main(String args)",
"public main(String[] args)",
"*public static void main(String[] args)",
null,
"Which of the following is a Java reserved word?",
"*new",
"old",
"fast",
"slow",
null
};
this.setLimittime(10);
this.setTotalMark(3);
int i = 0;
while(i < qinit.length) {
Question question = new Question();
question.setText(qinit[i++]);
String choiceText = qinit[i++];
while(choiceText != null) {
Choice choice = new Choice();
if(choiceText.charAt(0) == '*') {
choice.setCorrect(true);
choiceText = choiceText.substring(1);
}
choice.setText(choiceText);
question.addChoice(choice);
choiceText = qinit[i++];
} // end inner while loop
addQuestion(question);
} // end outer while loop
return true;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -