🌐
Tutorialspoint
tutorialspoint.com › java › java_serialization.htm
Java - Serialization
The test is simple: If the class ... class is used to serialize an Object. The following SerializeDemo program instantiates an Employee object and serializes it to a file....
🌐
GeeksforGeeks
geeksforgeeks.org › java › serialization-and-deserialization-in-java
Serialization and Deserialization in Java - GeeksforGeeks
June 1, 2026 - Create an ObjectInputStream object connected to the source containing the serialized data. Use the readObject() method to read the byte stream. The byte stream is converted back into the original Java object.
Discussions

Oracle Calls Java Serialization 'A Horrible Mistake', Plans to Dump It
All serialization systems seem to be not so great. Neither pickle in python nor marshal in ruby. All come with certain restrictions e. g. unable to store all properties of an object. I assume this to be not that dissimilar to java. More on reddit.com
🌐 r/programming
288
798
May 26, 2018
Boon JSON in five minutes, Faster Java JSON parsing, and serialization!

It's fast but at 246 source files (476 classes) it's not light.

More on reddit.com
🌐 r/java
1
3
January 6, 2014
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
Serialization of objects
Let's say you are creating a game in Java and you want to add the ability for the player to save it, and to load already saved game. One way to implement this is with Java serialization. It gives you the ability to convert a group of connected objects to a byte stream, which you can save in a file. Loading can then be implemented by reading this file and de-serializing the bytes back to Java objects. Or, in another use-case, you can send the byte-stream over the network to another process. This was the basis of Java RPC (Remote Procedure Call). There are many pitfalls and problems with the way Java serialization is implemented. For example, the loader needs to have access to all the needed classes, to be able to deserialize the objects. And the classes have to be the same version or you need to make sure they are compatible. Generally the Java Serialization API is quite brittle and last I checked, Oracle was planning to remove it from future versions of Java. Some of the alternatives to the Java Serialization API are serializing to JSON or XML using libraries like Jackson, GSON, etc. There are also Google's Protocol Buffers or similar approaches. Saving and loading objects in a database has also a lot in common with this, so for some use-cases one may choose that approach. More on reddit.com
🌐 r/learnjava
14
17
July 6, 2021
🌐
Medium
medium.com › @salvipriya97 › serialization-and-deserialization-explained-with-examples-5e2e45af97ee
Serialization and Deserialization explained with examples | by Priya Salvi | Medium
January 9, 2024 - ... Use Case: When objects need to be sent over a network between different applications or systems. Example: A client-server application where objects are sent between the client and server.
🌐
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 - If the programmer does not define this constant, Java does it for us. The serialization at runtime associates with each serializable class a serialVersionUID, which is used during deserialization to verify that the object that was converted to byte-stream is the one that is being retrieved. What if we do not want to save, i.e. serialize, the state of some data member of the class that gets serialized? In that case, we use a reserved keyword with the data member(s) that we do not want to serialize, like below:
🌐
DigitalOcean
digitalocean.com › community › tutorials › serialization-in-java
Serialization in Java - Java Serialization | DigitalOcean
August 3, 2022 - For example, uncomment only the serialVersionUID field from the Employee class and run SerializationTest program. Now uncomment the password field from Employee class and run the DeserializationTest program and you will see that the object stream is deserialized successfully because the change ...
🌐
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 - A marker interface has no methods to implement. It simply tells the JVM that objects of this class can be serialized. You use the ObjectOutputStream class to serialize objects. This class writes Java objects to an output stream.
🌐
Baeldung
baeldung.com › home › java › core java › introduction to java serialization
Introduction to Java Serialization | Baeldung
May 11, 2024 - Similarly, the most important method in ObjectInputStream is: public final Object readObject() throws IOException, ClassNotFoundException; This method can read a stream of bytes and convert it back into a Java object.
🌐
TechRepublic
techrepublic.com › home › devops
Serialization in Java Tutorial with Examples
October 19, 2023 - In this example, if Address doesn’t implement Serializable, a java.io.NotSerializableException will be thrown when trying to serialize a Person object.
Find elsewhere
🌐
Mkyong
mkyong.com › home › java › java serialization and deserialization examples
Java Serialization and Deserialization Examples - Mkyong.com
October 6, 2021 - Cluster of servers and restoring a session. For example, a cluster of servers (Server A and Server B) needs to synchronize the session if one of the servers is shut down or restart.
🌐
Medium
medium.com › @pratik.941 › serialization-and-deserialization-in-java-6dbd11fd31b3
Serialization and Deserialization in Java | by Pratik T | Medium
July 29, 2024 - To make a class serializable in Java, it must implement the `Serializable` interface, which is a marker interface (contains no methods).
🌐
Oracle
docs.oracle.com › javase › tutorial › jndi › objects › serial.html
Serializable Objects (The Java™ Tutorials > Java Naming and Directory Interface > Java Objects in the Directory)
It is the responsibility of the ... files. For example, a Java application might include in its classpath a JAR file that contains the class files of the serialized object(s) or load the class definitions by using information stored in the directory, as explained later in ...
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › ObjectOutputStream-example-Learn-Java-object-serialization
ObjectOutputStream example: A Java object serialization tutorial
With the ObjectOutputStream created an initialized, all that’s left to do is to perform Java serialization on the instance. Pass the score object as a parameter to the ObjectOutputStream’s writeObject method to achieve this: ... When Java object serialization is complete, both the ObjectOutputStream and the FileOutputStream can be closed. ... /* Start of Java serialization example class */ class JavaSerializationExample { public static void main (String args[]) { Score score = new Score(); saveScore(score); } public static void saveScore(Score score) { try { FileOutputStream fileOut = new FileOutputStream("C:\\score01.ser"); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(score); out.close(); fileOut.close(); } catch (Exception e) { e.printStackTrace(); } } } /* End of Java serialization tutorial class */
🌐
Simplilearn
simplilearn.com › home › resources › software development › understanding serialization in java with examples
Serialization in Java: Mechanism, Benefits & Examples
June 9, 2025 - Learn about serialization in Java and how to serialize objects with examples. Explore its benefits, deserialization, and key Java concepts in this guide.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
Blogger
javarevisited.blogspot.com › 2016 › 09 › how-to-serialize-object-in-java-serialization-example.html
Java Serialization Example - How to Serialize and Deserialize Objects in Java?Tutorial
We have seen both saving and restoring objects using serialization and de-serialization and also explored some key concepts related to how serialization works in Java. For example, transient and static variables are not saved during serialization, if you declare a static variable, make sure it's not final, and remember that constructor is not called during the de-serialization process.
🌐
BeginnersBook
beginnersbook.com › 2014 › 07 › java-serialization
Java Serialization
Serialzation Done!! This class would rebuilt the object of Student class after reading the stream of bytes from the file. Observe the output of this class, student address and student height fields are having null & 0 values consecutively. This is because these fields were declared transient ...
🌐
PVS-Studio
pvs-studio.com › en › blog › posts › java › 1190
Java serialization: let′s dig it up - PVS-Studio
November 22, 2024 - Serialization allows us to transfer the object over a network. Alternatively, we can serialize the object and save it to a file, so that upon the next program run, we can continue working with the same instance. In Java, we can't just serialize any object—the object should implement one of the following interfaces:
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › serialization-in-java
Serialization in Java: A Complete Guide
April 18, 2026 - The referenced class does not need to implement the Serializable interface explicitly unless it wants to define its own serialVersionUID or custom serialization logic. b) If the referenced class is not serializable, then the reference is not serialized or deserialized, and an exception is thrown at runtime. The class object cannot be serialized or deserialized unless the reference is marked as transient, which means it is excluded from the Serialization process. Here is an example of Java Serialization with aggregation:
🌐
GUVI
guvi.in › blog › full stack development › serialization in java: an informative guide to get you started from scratch
Serialization in Java: An Informative Guide From Scratch
January 7, 2026 - In this example, the Student class implements Serializable. This tells Java that Student objects can be converted into a byte stream.
🌐
Javatpoint
javatpoint.com › serialization-in-java
Serialization and Deserialization in Java
February 16, 2014 - Java transient Keyword In Java, Serialization is used to convert an object into a stream of the byte. The byte stream consists of the data of the instance as well as the type of data stored in that instance. Deserialization performs exactly opposite operation.
🌐
Intellipaat
intellipaat.com › home › blog › serialization in java (examples & methods)
Serialization in Java (Examples & Methods) - Intellipaat
July 22, 2025 - Serialization with aggregation (Has-A relationship) in Java involves serializing objects that are contained within another object. Here’s an example demonstrating serialization with aggregation: