读取文件中的内容
来源:互联网 发布:影响二次销售 淘宝介入 编辑:程序博客网 时间:2024/05/29 15:42
import java.util.* ;
import java.text.* ;
import java.io.* ;
public class ScannerDemo05{
public static void main(String args[]){
File f = new File("E:" + File.separator + "test.txt") ;// 指定操作文件
Scanner scan = null ;
try{
scan = new Scanner(f) ;// 从键盘接收数据
}catch(Exception e){}
StringBuffer str = new StringBuffer() ;
while(scan.hasNext()){
str.append(scan.next()).append('\n'); // 取数据
}
System.out.println("文件内容为:" + str) ;
}
};
import java.text.* ;
import java.io.* ;
public class ScannerDemo05{
public static void main(String args[]){
File f = new File("E:" + File.separator + "test.txt") ;// 指定操作文件
Scanner scan = null ;
try{
scan = new Scanner(f) ;// 从键盘接收数据
}catch(Exception e){}
StringBuffer str = new StringBuffer() ;
while(scan.hasNext()){
str.append(scan.next()).append('\n'); // 取数据
}
System.out.println("文件内容为:" + str) ;
}
};
0 0
- 读取文件中的内容
- C++读取文件中的内容
- Java读取文件中的内容
- shell读取文件中的内容
- 读取properties文件中的内容
- 关于读取文件中的中文内容
- 读取xml文件中的内容到HashTable
- 读取文件夹或者文件中的内容
- vc6.0读取xml文件中的内容
- PHP读取txt文件中的内容
- . <WP7>读取工程中的一个文件内容
- shell一行一行读取文件中的内容
- 通过C#读取ini文件中的内容
- 读取App.config文件中的内容
- R语言读取txt文件中的内容
- c语言:读取文件中的指定内容
- Java语言--读取文件中的内容
- 简单python逐行读取文件中的内容
- 文件读取的四种方式
- JFinal框架简单学习
- 第5周项目1 三角形4
- smdk210 构建根文件系统
- C语言编程在Xcode中Scanf 输入跳过以及清空键盘缓冲区总结
- 读取文件中的内容
- CodeForces 659A Round House(水题)
- 二级指针作输入之内存模型二
- 十二、平衡二叉树(2-3查找树、红黑二叉树)
- vmware 虚拟机下 ubuntu 与主机共享锐捷
- Android之NDK开发
- 关于JWT
- 对SQL Server的操作
- 两个有序数组元素之积、和的最小K个值