What is serialization? Any methods in serialization? What is externalization?

This question is related to Oracle Interview

Showing Answers 1 - 3 of 3 Answers

mohana

  • Jan 20th, 2006
 

  • Write object state into persisten secondary storage device.
  • Serializable is an interface. Which does nt have any in it.
  • It will inform the JVM that implemented class state should be serialize. Except transisent data type instance variable

  Was this answer useful?  Yes

uga durga prasad

  • Aug 14th, 2007
 

Serialization is the process of  storing the state of an object into IO Stream, it is a Marker interface and it will not have any methods in it.

  Was this answer useful?  Yes

Serialization is the process of converting an object into a sequence of bits
so that it can be stored on a storage medium (such as a file, or a memory
buffer) or transmitted across a network connection link. When the resulting
series of bits is reread according to the serialization format, it can be used
to create a semantically identical clone of the original object. For many
complex objects, such as those that make extensive use of references this
process is not straight forward.


Serialization is a mechanism by which you can save the state of an object by
converting it to a byte stream. Two types:


1.Binary Serializable
2.XML Serializable


Methods: The serializable interface is an empty interface, it does not
contain any methods. So we do not implement any methods.


Use: Whenever an object is to be sent over the network, objects need to be
serialized. Moreover if the state of an object is to be saved, objects need to
be serialized.


Externalizable: Externalizable is an interface which contains two methods
readExternal and writeExternal. These methods give you a control over the
serialization mechanism. Thus if your class implements this interface, you can
customize the serialization process by implementing these methods.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions