第21讲Java的输入与输出流(下)1699.pptVIP

  • 3
  • 0
  • 约5.74千字
  • 约 18页
  • 2018-06-23 发布于湖北
  • 举报
第21讲Java的输入与输出流(下)1699.ppt

例11.7应用类RandomAccessFile编写程序,实现将两个磁盘文件input1.txt和input2.txt中的内容合并,并显示在屏幕上。 import java.io.*; public class Ex11_7{ public static void main(String args[]){ String s=; try{ RandomAccessFile f1=new RandomAccessFile(c:/input1.txt,rw); RandomAccessFile f2=new RandomAccessFile(c:/input2.txt,rw); s=f1.readLine()+f2.readLine(); char c[]=s.toCharArray(); for(int i=0;is.length();i++) System.out.print(c[i]); System.out.println(); } catch(Exception e){} } } * bhmjk,jh n,jljl bhmjk,jh n,jljl bhmjk,jh n,

文档评论(0)

1亿VIP精品文档

相关文档