逐行扫描文件,并逐行输出
public static void main(String[] args) throws FileNotFoundException
{
InputStream in = new FileInputStream(new File("C:\\windows"));
Scanner s = new Scanner(in);
while(s.hasNextLine()){
System.out.println(s.nextLine());
}
}
InputStream in = new FileInputStream(new File("C:\\windows"));
Scanner s = new Scanner(in);
while(s.hasNextLine()){
System.out.println(s.nextLine());
}
}
1万+

被折叠的 条评论
为什么被折叠?



