Beruflich Dokumente
Kultur Dokumente
JAVA CH-4
DEPARTMENT OF MCA
4.2.7 Serialization
This is useful when you want to save the state of your program to a persistent storage area,
such as a file.
At a later time, you may restore these objects by using the process of deserialization.
RMI allows a Java object on one machine to invoke a method of a Java object on a different
machine.
The sending machine serializes the object and transmits it. The receiving machine deserializes
it.
Serializable
object that implements the Serializable interface can be saved and restored by the serialization
facilities.
The Serializable interface defines no members. It is simply used to indicate that a class may
be serialized.
Variables that are declared as transient are not saved by the serialization facilities. Also,
E-Mail: khutub27@gmail.com
26
SEM-III
JAVA CH-4
DEPARTMENT OF MCA
This program demonstrates that the instance variables of object1 and object2 are identical.
OUTPUT:
object1: s=Hello; i=-7; d=2.7E10
object2: s=Hello; i=-7; d=2.7E10
E-Mail: khutub27@gmail.com
27