PrintWriter writer = new PrintWriter(new FileOutputStream("c:/myword.txt"), true);
解决方案 »
- 我彻底蒙了:JAVA小程序中,声音播放不了
- java一个简单问题。我是新手
- 关于js的document.write()
- JAVA基础题希望各位朋友帮个忙
- 请教
- 滚动条问题```急```
- 关于Applet小程序(在线等)!
- 问一个泛型的问题,代码粘贴如下,谢谢
- 菜菜的问题,jsp与j2ee是一回事不,如果不是一回事,有什么不同,没分了但也想知道
- 使用jmf包编写了一小段代码播放mp3,程序编译没报错,能运行,但没有声音,请大神帮忙
- http://www.5ie.net有Core Java 2 Volume II-Advanced Features 5th Edition下载
- 请教:java程序语言、java平台、java虚拟机的区别与联系
File file = new File("C:\\Documents and Settings\\Administrator.QING\\桌面\\wenjian1.txt");
另外,最好不要用中文的路径;
还有建立文件的时候最好捕捉下面几个异常:
FileNotFoundException和IOException
String s = "He said:\"I am a Student.\"";
and if you want to use "\" you must write "\\" .
String s = "He said:\"I am a Student.\"";
and if you want to use "\" you must write "\\" .或者用/也可以
改成File file=new File("C:/Documents and Settings/Administrator.QING/桌面/wenjian1.txt");