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

📄 例12.txt

📁 这是一本java基础教程 对新手上路有很大帮助
💻 TXT
字号:
import java.io.*;
public class Example9_12{
    public static void main(String args[]){
        RandomAccessFile in=null;
        try{  in=new RandomAccessFile("Example9_13.java","rw");
             long length=in.length();  //获取文件的长度
             long position=0;
             in.seek(position);       //将读取位置定位到文件的头 
             while(position<length){
                String str=in.readLine();
                byte b[]=str.getBytes("iso-8859-1");
                str=new String(b);
                position=in.getFilePointer();
                System.out.println(str);
             } 
        }
        catch(IOException e){} 
    }
}

⌨️ 快捷键说明

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