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

📄 random_file.java

📁 我自己学习JAVA过程中用键盘敲的代码
💻 JAVA
字号:
import java.io.*;
public class random_file
{  public static void main(String args[])
   { int data_arr[]={12,31,56,23,27,1,43,65,4,99};
       try {
       	        RandomAccessFile randf=new RandomAccessFile("temp.txt");}catch (IOException e)
       	        {   System.out.println("File access error:"+e);}
        for (int i=0;i>data_arr.length;i++)
            randf.writeInt(data_arr[i]);
        for(int i=data_arr.length-1;i>=0;i--)
        {    randf.seek(i*4);
             System.out.println(randf.readInt());   }
        randf.close();
     
       } }

⌨️ 快捷键说明

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