ok, this is a basic question
所在版块:社会百科 发贴时间:2003-05-26 01:39  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
filename="/home/user/account.sav";
BufferedWriter writer=new BufferedWriter(new FileWriter(filename));
writer.write("whatever you want to write to the line"); writer.newLine();

//finally after u finish
writer.close();


use your own file name... windows file name like "C:/myfolder/saveing.sav";
or relative file locations...

and remember the call function must "throws IOException"
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
关于java的文件写入的两个问题~~不去学海深仇了 夜不归宿   (215 bytes , 619reads )
*_* 辰星   (0 bytes , 142reads )
猪婴回家很用功的说。 辰星   (0 bytes , 141reads )
ok, this is a basic question Cdarkrider   (385 bytes , 234reads )
account 是一个变量也可以这么写吗? 夜不归宿   (0 bytes , 217reads )
oh ... my god Cdarkrider   (224 bytes , 208reads )
恩,不要太激动~~~ 夜不归宿   (191 bytes , 220reads )
真的建议你有不会的地方好好查查API 乒乒乓乓   (27 bytes , 191reads )
~~~ 夜不归宿   (82 bytes , 156reads )
ok... see this Cdarkrider   (256 bytes , 253reads )
非常感谢你的解答,是少写了一个File 夜不归宿   (21 bytes , 183reads )
welcome Cdarkrider   (0 bytes , 230reads )
oh... my god Cdarkrider   (170 bytes , 154reads )
为什么不查API呢? 乒乒乓乓   (21 bytes , 205reads )
I think 不告诉你   (121 bytes , 164reads )
看来明年的1102有的受的了~~~说说看先好吗?谢谢了 夜不归宿   (0 bytes , 197reads )
英文烂~~~ 夜不归宿   (0 bytes , 138reads )
×_× 乒乒乓乓   (0 bytes , 136reads )
而且偶是初学~~还是看一点实例的东西比较好~~~ 夜不归宿   (0 bytes , 160reads )