⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randiotest.java

📁 这是一张java应用教程的随书光盘
💻 JAVA
字号:
import java.io.*;
class randIOTest
{
  public static void main(String[] args)
  {
   try{
       RandomAccessFile f1=new  RandomAccessFile("c:\\qq\\write.txt","rw");
       for(int i=1;i<=5;i++)
        {f1.writeBytes("hello,this is the   "+i+"  row"+"\n");
         }
       f1.close();
       String record=new String();
       RandomAccessFile f2=new  RandomAccessFile("c:\\qq\\write.txt","rw");
       f2.seek(f2.length());
       f2.writeBytes("this is a good demo!"+"\n");
       f2.close();
       RandomAccessFile f3=new  RandomAccessFile("c:\\qq\\write.txt","rw"); 
       while((record=f3.readLine())!=null)
        {
          System.out.println(record);
         }
        f3.close();
       }catch(Exception e){}
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -