import java.io.*; public class InimLugeja{ public static void main(String[] arg) throws Exception{ ObjectInputStream sisendobjektid=new ObjectInputStream( new FileInputStream("inimandmed.dat") ); try{ Object o=sisendobjektid.readObject(); while(o!=null){ Inimene abi=(Inimene)o; System.out.println(abi); o=sisendobjektid.readObject(); } } catch(EOFException ex){ System.out.println("andmed otsas"); } sisendobjektid.close(); } }