java 核心课件-第13章.pptVIP

  • 4
  • 0
  • 约1.19万字
  • 约 33页
  • 2017-08-15 发布于北京
  • 举报
java 核心课件-第13章.ppt

第13章 I/O流 熟练使用File类的常用方法; 理解流,及其层次结构; 能熟练使用字节流和字符流类对文件进行读写操作。 31.1 File类 File f = new File(my.txt); f.createNewFile(); f.mkdir(); File f = new File(F:\\myjavaclass8\\1.txt); f.createNewFile(); File fDir = new File(File.separator + myjavaclass8 ); String strFile = File.separator + “1.txt; File f = new File(fDir, strFile); f.createNewFile(); File[] arrFile = f.listFiles(); File[] arrFile = f.listFiles(new Test()); public boolean accept(File dir, String name) { return name.indexOf(.java) != -1; } 13.2 流的概念 流是程序和外界进行数据交换的通道; 它是一种抽象观念,如从键盘输入数据、将结果输出到显示器、打开与保存文件等操作皆视为流的处理。我们可通过它来读写数据,

文档评论(0)

1亿VIP精品文档

相关文档