-2

So after programming for a little while now, I've run into the word serializing in Java. I've come across it a few times in some Java programs I've seen, and I've just kind of been wondering exactly what serializing is, how it works, and how I can use it in a program.

I've also been wondering what exactly a serialversionUID is, and what its purpose is.

Thank you.

Krusty the Clown
  • 517
  • 6
  • 24
  • To serialize an object means to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object. A Java object is serializable if its class or any of its superclasses implements either the `java.io.Serializable` interface or its subinterface, `java.io.Externalizable`. Deserialization is the process of converting the serialized form of an object back into a copy of the object. – Edwin Dalorzo Oct 11 '15 at 02:47
  • Refer to this question and link in that post : http://stackoverflow.com/questions/31524162/use-of-serializable-other-than-writing-reading-object-to-from-file/31541629#31541629 – Ravindra babu Oct 11 '15 at 04:04
  • You may find the [Java Serialization Specification](https://docs.oracle.com/javase/8/docs/platform/serialization/spec/serialTOC.html) informative. – VGR Oct 11 '15 at 06:09

1 Answers1

1

"Serialization is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer, or transmitted across a network connection link) and reconstructed later in the same or another computer environment." Wikipedia

So basically you are implementing a way for an object to be translated into a format that can be transmitted and then reconstituted back to the same object in the same state at another point in time.

Michael
  • 519
  • 4
  • 14