写文件的问题. 打开文件是可以用添加模式FileWriter writer =new FileWriter("file.txt",true) ~~~~~最后的 true 表示写入的内容将被添加在原有文件之后 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try:StringBuffer txtConcent = new StringBuffer() ;String sSrcName="c:\\test.txt";txtConcent.append("abc\n") ;try { PrintWriter pw = new PrintWriter(new FileWriter(sSrcName, true), true); pw.println(txtConcent.toString()); } catch (Exception e) { System.out.println("error"); }} public void writeToFile(String filename, String msg, boolean append){ PrintWriter out; //String filename = filename; try{ out = new PrintWriter(new BufferedWriter(new FileWriter(filename, true)), append); out.println(msg); }catch(IOException ioe){ System.out.println(ioe); } } writeToFile("Hello World!\n", "c:\\out.txt", true); 内部类实现接口的问题 问一个类型转换的菜鸟问题 JInternalFrame 能不能设置成不被拖动的 计算机专业的毕业设计应该是什么样? 现在还有没有大学生能找个兼职的公司阿 请指点一下 初学者遇到个问题,期待大神解答 请问各位大侠那里能下到jdbcdriver for access? JBuilder6中怎么调用右键菜单? 为什么没结果 谁可以告诉我JBuilder4的注册码? 请问哪位知道Cloudscape下载地址?
String sSrcName="c:\\test.txt";
txtConcent.append("abc\n") ;
try
{
PrintWriter pw = new PrintWriter(new FileWriter(sSrcName, true), true);
pw.println(txtConcent.toString());
}
catch (Exception e)
{
System.out.println("error");
}
}
PrintWriter out;
//String filename = filename;
try{
out = new PrintWriter(new BufferedWriter(new FileWriter(filename, true)), append);
out.println(msg);
}catch(IOException ioe){
System.out.println(ioe);
}
} writeToFile("Hello World!\n", "c:\\out.txt", true);