- 博客(2)
- 收藏
- 关注
转载 Java中向指定txt文件追加内容
void appendContent(String fileName, String content) { RandomAccessFile randomFile = null; try { // 打开一个随机访问文件流,按读写方式 randomFile = new RandomAccess
2016-06-16 22:23:56
1322
原创 Java中从指定txt读取文件
import java.io.File;import java.util.Scanner;//关键代码如下:try { Scanner sc=new Scanner(new File("./user.txt")); //读文件操作 while(sc.hasNextLine()){ System.out.println(sc.next()); } c
2016-06-16 22:14:23
464
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅