🌐
GeeksforGeeks
geeksforgeeks.org › java › serialization-and-deserialization-in-java
Serialization and Deserialization in Java - GeeksforGeeks
June 1, 2026 - Serialization and Deserialization are important Java mechanisms used to convert objects into a byte stream and reconstruct them back into objects. Together, they enable object persistence, data transfer, and communication between different systems while preserving an object's state.
🌐
Medium
medium.com › @pratik.941 › serialization-and-deserialization-in-java-6dbd11fd31b3
Serialization and Deserialization in Java | by Pratik T | Medium
July 29, 2024 - Serialization and Deserialization in Java Serialization is the process of converting an object into a byte stream, making it possible to store the object or transmit it over a network …
Discussions

java - Difference between serializing and deserializing and writing internals to a file and then reading them and passing them in constructor - Stack Overflow
In your first approach, you are ... between the data values (in the sense that you store the data and then read it back and construct the object back). In the second approach, Java does this for you behind the scenes. ... Save this answer. ... Show activity on this post. ... Serialization is a process by which we can store the state of an object into any storage medium. We can store the state of the object into a file, into a database table etc. Deserialization is the opposite ... More on stackoverflow.com
🌐 stackoverflow.com
Explain like i'm five - what is Serializable?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
9
24
April 26, 2024
What is Deserialize & Serialize?
When you need to get data out of your program, out of it's process memory, you need to shape it in a linear string - serialize. It doesn't have to be a text string, you have standard binary serialization formats, or you can roll your own (don't). And on the other side, you deserialize from this linear string into objects stored in (another) program's process memory. You most often can't just raw copy data from process memory because that data is not tagged, in no standard order or format, not linear, not stored in one place, or contains information that would be wrong in other program's memory, like pointers and metadata. More on reddit.com
🌐 r/algorithms
6
7
December 11, 2016
Java serialization/deserialization?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full - best also formatted as code block You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnjava
9
5
April 15, 2024
🌐
Mytectra
mytectra.com › tutorials › core-java › serialization-and-deserialization
Core Java - Serialization and Deserialization
Serialization is a process in Java that allows you to convert an object's state into a byte stream, which can be stored in a file, transmitted over a network, or saved in a database. Deserialization, on the other hand, is the reverse process where you convert a byte stream back into an object's ...
🌐
Scaler
scaler.com › home › topics › java › serialization and deserialization
serialization and deserialization - Java
March 28, 2024 - Serialization in simple terms means converting an object into a sequence of bytes, deserialization is exactly the opposite. In deserialization, an object is reconstructed back from the sequence of bytes.
🌐
Medium
medium.com › @salvipriya97 › serialization-and-deserialization-explained-with-examples-5e2e45af97ee
Serialization and Deserialization explained with examples | by Priya Salvi | Medium
January 9, 2024 - Java Interface: The Serializable interface in Java is a marker interface that indicates a class can be serialized. Definition: Deserialization is the process of reconstructing an object from a byte stream.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › serialization and deserialization in java with examples
Serialization and Deserialization in Java with Examples
June 27, 2025 - Deserialization is the reverse process of serialization. It converts a byte stream back into an object. This reconstructs the object in memory. You use the ObjectInputStream class to deserialize objects.
🌐
TutorialsPoint
tutorialspoint.com › What-is-the-difference-between-Serialization-and-Deserialization-in-Java
What is the difference between Serialization and Deserialization in Java?
After a serialized object has been written into a file, it can be read from the file and Deserialized that is, the type information and bytes that represent the object and its data can be used to recreate the object in memory. import java.io.*; public class DeserializeDemo { public static void ...
🌐
Baeldung
baeldung.com › home › core concepts › programming › what are serialization and deserialization in programming?
What Are Serialization and Deserialization in Programming? | Baeldung on Computer Science
March 18, 2024 - In Java, the ObjectInputStream class can be used to deserialize a binary format, and the Jackson library can be used to parse a JSON format. Here’s a view of how deserialization looks like: Serialization and deserialization are important in programming because they allow objects to be easily stored and transmitted between different ...
Find elsewhere
🌐
Snyk
snyk.io › blog › serialization-and-deserialization-in-java
Serialization and deserialization in Java | Snyk Blog | Snyk
December 18, 2020 - With deserialization, you start with a byte stream and re-create the object you previously serialized in its original state. However, you must have the definition of the object to successfully re-create it.
🌐
SevenMentor
sevenmentor.com › java-serialization-and-deserialization-explained
Java Serialization and Deserialization Explained
November 12, 2025 - In summary: serialization converts a Java object into a byte stream so that it can be persisted or transmitted; deserialization reconstructs the object from the byte stream. The built-in Java mechanism (via Serializable, ObjectOutputStream, ObjectInputStream) makes this fairly straightforward—but ...
🌐
Scaler
scaler.com › home › topics › java › serialization and deserialization in java with example
Serialization and Deserialization in Java with Example - Scaler Topics
February 22, 2024 - When a parent class implements ... Serializable, it doesn't automatically apply to the parent. Serialization in Java only preserves non-static data members; static and transient data members are excluded from the process....
🌐
Baeldung
baeldung.com › home › java › core java › introduction to java serialization
Introduction to Java Serialization | Baeldung
May 11, 2024 - Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time. ... Serialization is the conversion of the state of an object into a byte stream; deserialization does the opposite.
Top answer
1 of 5
5

Read this article, explains pretty good what is serialization about (it is for Java RMI but the serialization explanation and problems are the same): http://oreilly.com/catalog/javarmi/chapter/ch10.html

The main differences I see is that:

  • (As the other answers says) you are responsible to serialize - deserialize. What is going to happen when one of the properties is another big complex class? What are you going to do then? Save its value as well?
  • Serialization depends on reflection, while the file thing depends on getters/setters/constructors. With reflection you don't need public setters/getters or a constructor with parameters. With the file thing you need them.

Extracted from the link above:

Using Serialization

Serialization is a mechanism built into the core Java libraries for writing a graph of objects into a stream of data. This stream of data can then be programmatically manipulated, and a deep copy of the objects can be made by reversing the process. This reversal is often called deserialization.

In particular, there are three main uses of serialization:

  • As a persistence mechanism. If the stream being used is FileOutputStream, then the data will automatically be written to a file.
  • As a copy mechanism. If the stream being used is ByteArrayOutputStream, then the data will be written to a byte array in memory. This byte array can then be used to create duplicates of the original objects.
  • As a communication mechanism. If the stream being used comes from a socket, then the data will automatically be sent over the wire to the receiving socket, at which point another program will decide what to do.

The important thing to note is that the use of serialization is independent of the serialization algorithm itself. If we have a serializable class, we can save it to a file or make a copy of it simply by changing the way we use the output of the serialization mechanism.

2 of 5
2

In your first approach, you are responsible for maintaining the logical relationship between the data values (in the sense that you store the data and then read it back and construct the object back).

In the second approach, Java does this for you behind the scenes.

🌐
Tpoint Tech
tpointtech.com › serialization-in-java
Java Serialization | Serialization and Deserialization in Java - Tpoint Tech
March 17, 2026 - Data can be kept between program executions by using serialized objects, which can be saved to a disc or a database and then retrieved. Deserialization is the reverse process of serialization. It converts the byte stream back into a Java object, restoring its original state.
🌐
Just Academy
justacademy.co › blog-detail › difference-between-serialization-and-deserialization-in-java
Difference Between Serialization And Deserialization In Java
April 6, 2024 - 1 - Serialization in Java is the process of converting an object into a stream of bytes to store or transmit it. Deserialization, on the other hand, is the process of reconstructing an object from its serialized form back into memory.
🌐
Quora
quora.com › What-is-the-difference-between-serialization-and-deserialization-in-core-Java
What is the difference between serialization and deserialization in core Java? - Quora
Answer (1 of 5): Serialization and Deserialization in Java with Example Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used ...
🌐
CodeGym
codegym.cc › java blog › serialization in java › what is the difference between serialization and deserial...
What is the difference between serialization and deserialization in Java?
May 25, 2023 - For this is precisely what serialization and deserealization are for. Serialization is the process of storing the state of an object in a sequence of bytes. Deserialization is the process of restoring an object from these bytes.
🌐
Quora
quora.com › What-is-Serialization-and-Deserialization-in-Java
What is Serialization and Deserialization in Java? - Quora
Answer (1 of 4): Serialization is used to convert the object format to byte of streams to save the state of the object.(Generally File). Deserialization means opposite of it. Here we use byte of streams i.e file to retrieve the saved state of the object. A Java object can be serialized only if ...
🌐
Studytonight
studytonight.com › java › serialization-and-deserialization.php
serialization and deserialization in java
... Learn Coding! ... Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization.