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

📄 filereader.java

📁 初期JAVA学习非常有用的资料。帮助深入了解API。特别是Applet。
💻 JAVA
字号:
import java.io.*;public class FileReader {    public static void main(String[] args) {	try {	    long dataPosition = 0;	    int data = 0;            RandomAccessFile raf = new RandomAccessFile("datafile", "r");	    //Get the position of the data to read.	    dataPosition = raf.readLong();	    //Go to that position.	    raf.seek(dataPosition);	    //Read the data.	    data = raf.readInt();	    raf.close();	    //Tell the world.	    System.out.println("The data is: " + data);	} catch (FileNotFoundException e) {	    System.err.println("This shouldn't happen: " + e);	} catch (IOException e) {	    System.err.println("Writing error: " + e);	}    }}

⌨️ 快捷键说明

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