package lab3vector; import java.util.*; import java.io.*; public class lab3vector { public lab3vector() { } public static void main(String[] args) { int i; Vector V1; V1 = new Vector(); for (i=0; i<=99; i++) { V1.addElement(new Integer (i)); } try { FileOutputStream fos; ObjectOutputStream oos; fos = new FileOutputStream("t.tmp"); oos = new ObjectOutputStream(fos); oos.writeObject(V1); oos.flush(); fos.close(); FileInputStream fis; ObjectInputStream ois; fis = new FileInputStream("t.tmp"); ois = new ObjectInputStream(fis); Vector a1 = (Vector) ois.readObject(); fis.close(); System.out.println("A:" + a1); } catch (IOException e) { System.out.println(e);} catch (ClassNotFoundException e) { System.out.println(e);} for (;;); } }