Wednesday, February 24, 2016

What is Serialization in java ?

Serialization is a type of mechanish or process in java using which an object state can be saved in a stream of bytes and its a platform independent so object serialized in one platform can be deririalize in anothe platform.

UseCase
When an object is converted into Bytes Stream then that object can be 
Serialized object can be Stored into database
Serialized object can be stored/write into file
that object can be send over the network
that object can be stored into memory

In java serializable interface is a marker interface there is no method in that interface.
When you want any class object to be serialized then you need to implement the serializable interface.
whenever any object is being serialized then all the member of the object is serialzed except transient and static variables.

also take a look at when to use Volatile ? and  when to use transient ? in java



No comments:

Post a Comment

Scrum and Scrum master

Scrum  Scrum is a framework which helps a team to work together.  It is like a rugby team (the scrum name comes from rugby game). Scrum enco...