import java.io.*; class Program01 { public void kiir() throws IOException { System.out.println("Kiírás"); RandomAccessFile file = new RandomAccessFile("adat.txt", "rw"); file.seek(20); file.writeUTF("alma"); file.seek(40); file.writeUTF("körte"); file.seek(60); file.writeUTF("barack"); file.seek(80); file.writeUTF("szilva"); file.close(); } public void olvas() throws IOException { RandomAccessFile file = new RandomAccessFile("adat.txt", "r"); file.seek(40); System.out.println(file.readUTF()); file.seek(60); System.out.println(file.readUTF()); file.close(); } public static void main(String args[]) throws IOException{ new Program04().kiir(); new Program04().olvas(); } }