解决方案 »
- 关于命令行运行java,找不到main的问题
- 关于java中分割数据的问题
- 高分,向高手提问 java.io.IOException:underlying input stream returned zero bytes
- 急求标准输入BYTE和STRING转换问题
- 关于Eclipse中ant的使用
- 一个关于Random()的问题!!!!!!!!!!!!!!!
- 请Anubis(为朋友两肋插刀,为MM插朋友两刀!!) 进来领分
- 遇到一个新职位,软件测试,而我对这它一点都不了解,请大家提提意见!
- 请问怎么更新JB4自带的JDK?????
- 有没有谁用过Cloudscape做为JAVA的后台数据库,据说和JAVA整合的很好,本人没有用过
- 关于缓冲流的问题
- swing中的label隐藏后,我想让下面的label补充隐藏的label的位置
private ArrayList<String> command;
private Parser parser;
public Command(){
command = new ArrayList<String>();
parser = new Parser();
command.add(parser.getFirstWord());
command.add(parser.getSecondWord());
}
public String getFirstCommand(){
return command.get(0);
}
public int getSecondCommand(){
return Integer.parseInt(command.get(1));
}
}WriteFile类
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;public class WriteFile {
private String report;
private String result;
private PrintWriter pwCheck;
private PrintWriter pwResult;
public WriteFile(){
this.report = "";
this.result = "";
}
public void Write(String s){
report += s;
try {
pwCheck = new PrintWriter(new FileOutputStream("check.txt"));
} catch (FileNotFoundException e) {
System.out.println("cannot create or write file");
}
pwCheck.println(report);
pwCheck.close();
}
public void Result(String info){
result += info;
try {
pwResult = new PrintWriter(new FileOutputStream("result.txt"));
} catch (FileNotFoundException e) {
System.out.println("cannot create or write file");
}
pwResult.println(result);
pwResult.close();
}
}