📄 storequestionchoice.java
字号:
package fangsoft.testcenter.driver;
import fangsoft.testcenter.model.Constants;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class StoreQuestionChoice {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
String[] practice = { "Which is correct?", "int a = new int(1);",
"int a = new Integer(1);", "*int a = 1;", "Integer a = 1;",
null, "J2SE stands for:", "Java 2 Special Edition",
"Java 2 Service Editor",
"Nothing, It simply stands for itself",
"*Java 2 Standard Edition", null,
"Platform independence means:",
"*Not tied to one hardware or software architecture",
"Needs no platform", "Difficult to control on a platform",
"Only one platform can be used", null };
String[] Certification = { "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 of the following is a Java reserved word?", "*new",
"old", "fast", "slow", null };
int i = 0, code;
while (i < practice.length) {
String QuestionText = practice[i++];
code = QuestionText.hashCode();
FileWriter file = new FileWriter(Constants.PRACTEST_FILE_NAME
+ "QuestionChoice-" + code + ".txt");
BufferedWriter writer = new BufferedWriter(file);
writer.write(QuestionText + "\n");
String choiceText = practice[i++];
while (choiceText != null) {
writer.write(choiceText + "\n");
choiceText = practice[i++];
} // end inner while loop
writer.close();
} // end outer while loop
i = 0;
while (i < Certification.length) {
String QuestionText = Certification[i++];
code = QuestionText.hashCode();
FileWriter file = new FileWriter(Constants.CERTTEST_FILE_NAME
+ "QuestionChoice-" + code + ".txt");
BufferedWriter writer = new BufferedWriter(file);
writer.write(QuestionText + "\n");
String choiceText = Certification[i++];
while (choiceText != null) {
writer.write(choiceText + "\n");
choiceText = Certification[i++];
} // end inner while loop
writer.close();
} // end outer while loop
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -