Copyright © 2001 Qusay H. Mahmoud
Programming
lBesides an object, you need an I/O stream
lTo save the state:
–Create an instance of ObjectOutputStream (it is a subclass of FilterOutputStream)
–Use writeObject() to save the state of the object
lTo read the state:
–Create an instance of ObjectInputStream (it is a subclass of FilterInputStream)
–Use readObject() to read the state of the object
–You must know what type of object is expected in the stream