what is the difference between serialized bean and a non serialized bean?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Siddarth777
    New Member
    • Sep 2010
    • 28

    what is the difference between serialized bean and a non serialized bean?

    Hi,
    I have gone through the concept of serialization in java very recently, i understood what serialization means in java,

    but why serialization is required in beans?

    as i have done some research on net, i found that persistence can be achieved, i did not not understand how persistence can be achieved by using serialization.

    can some one please shed some light on this?
    with an example is really appreciated

    Thanks a lot in advance
    Siddarth777
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    I think you need to start with the basics again.


    The answer really, truely, is there...

    -z

    Comment

    • om26
      New Member
      • Sep 2012
      • 1

      #3
      serializable interface is called as marker interface or null interface or singling interface.
      what does, the system looks if the class implements the interface, it behaves in one way, if the class does not implement the interface it behaves in other way means the object of this class needs to be treated differently.

      by default system does not like making backup of the object, it takes time.
      if you want the system to take backup of your object, system tells then you better implement the interface Serializable.

      Example:-Serializable, Remote, Cloneable.
      An object state can be saved by serializing an object.
      To serialize an object we need an object output stream.
      Serialization of an object means writing the value of its all data fields into a stream of bytes.
      A class can be de-serialized by using object input stream.
      Serialization is the process of writing the current state of an object to a stream. To serialize an object the class must implement either java.io.seriali zable or java.io.externa lizable.

      Comment

      Working...