Java Programing laungage

Java Input Output Projects

Java I/O Project 1

Java Input Output Examples

Java Input Output Examples

Make class Serializable

We know that the serializable interface has no methods, so we do not need to change the name of the class. to make a serializable class only follow these steps below:

Previous Home Next

    • Firstly create the object of the ObjectOutputStream so that we can write the objects for the specified OutputStream.
      ObjectOutputStream(OutputStream out)
    • Write the object for the ObjectOutputStream. by this method save the class of the object, class signature, and the values of the any non-static, non-tranciant of the class and its super classes.
      void writeObject(Object obj);)

    • create the Object.InputStream to read back objects information for specified InputStream.
      ObjectInputStream(InputStream inp);
    • Read the object from the ObjectInputStream. it is read the back class of the object, class signature,non-transient values, non-static field of the class and all super classes. by help of the this code the object is serialized the multiple object references.
Previous Home Next