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

📄 example7_7.java

📁 《Java程序设计与应用》-张仕斌-源程序 《Java程序设计与应用》-张仕斌-源程序
💻 JAVA
字号:
/*
 * Example7_7.java
 *
 * Created on 2006年9月16日, 上午12:31
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package example7_7;
import java.io.*;

/**
 *
 * @author Administrator
 */
public class Example7_7 {
    
    /** Creates a new instance of Example7_7 */
    public Example7_7() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        // TODO code application logic here
 	RandomAccessFile in_and_out=null;
		int data[]={1,2,3,4,5};
		try{in_and_out=new RandomAccessFile("tom.dat","rw");}
			catch(Exception e){}
			try{ for(int i=0;i<data.length;i++){in_and_out.writeInt(data[i]);}
				for (long i=data.length-1;i>=0;i--)
					{in_and_out.seek(i*4);
					 System.out.print(","+in_and_out.readInt());
					}
				in_and_out.close();
			}
			catch(IOException e){}

    }
    
}

⌨️ 快捷键说明

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