Serializable

  • Serialisation is a concept where we can convert an object to binary format
  • We can perform serialization Using externalizable interface or by extending serialisable interface and Overriding serialize method.
  • externalizable is used in cases where parent class does not extend serializable But we want parent class to be serlized.
    • We use write external and Read external methods.
  • We serialise using readObject() and writeObject() methods.
  • If we don’t want to serialise a property Then we use transient Annotation.
  • The process of converting an object state into a format that can be easily transmitted and reconstructed back Is called as serialisation.
  • We should not serialize data in Text files as it is in binary format. It will cause and encoding issues Making it unreadable Or causing loss of information. Better to use file format like .bin etc.
    • For human variable format, we can save it as Jason.

No comments:

Post a Comment