






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







public class Data implements Serializable { public static void main(String[] args) throws ClassNotFoundException, IOException { Data d = new Data(); ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream("data.out")); out.writeObject("Data storage"); out.writeObject(d); out.close();
ObjectInputStream in = new ObjectInputStream( new FileInputStream("data.out")); String s = (String)in.readObject(); Data d2 = (Data)in.readObject(); } } Docsity.com
public abstract void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
public abstract void writeExternal(ObjectOutput out) throws IOException
// Now deserialize ObjectInputStream in = new ObjectInputStream( new FileInputStream("data.out")); d = (Data)in.readObject(); } }