Java tutorial
import java.io.*; public class Main { public static void main(String[] args) { try { int f = 1234; RandomAccessFile raf = new RandomAccessFile("c:/test.txt", "rw"); raf.writeInt(f); raf.seek(0); System.out.println(raf.readInt()); raf.seek(0); raf.writeInt(200); raf.seek(0); System.out.println(raf.readInt()); raf.close(); } catch (IOException ex) { ex.printStackTrace(); } } }