{"id":78883,"date":"2020-05-30T10:00:40","date_gmt":"2020-05-30T04:30:40","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=78883"},"modified":"2020-05-30T10:00:40","modified_gmt":"2020-05-30T04:30:40","slug":"serialization-in-java","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/","title":{"rendered":"Serialization in Java &#8211; Concept that Cannot be Missed"},"content":{"rendered":"<p>Welcome back to <strong>TechVidvan Java Tutorial series<\/strong>. In our last tutorial, we discussed Packages in Java. In this tutorial, we are going to learn the process of <strong>Serialization in Java and Deserialization in Java<\/strong>.<\/p>\n<p>We will cover both Java Serialization and Deserialization with real-time examples and programs. And, also the advantages and disadvantages of Serialization and Deserialization in Java.<\/p>\n<p>So, let us start with the concept of Serialization and Deserialization in Java.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78920\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg\" alt=\"Serialization and Deserialization in Java\" width=\"802\" height=\"420\" \/><\/a><\/p>\n<h3>Serialization and Deserialization in Java<\/h3>\n<p>The basic concept is that we will convert the object into the form of a byte array and we will send that byte array to the server that we will again convert this byte array into the object.<\/p>\n<p>Basically the process of converting the object into the byte stream is called Serialization; we say that we serialize the object into the byte array. And, when we convert the byte stream back to the object then we call it Deserialization; we say that the byte stream is being deserialized to the object.<\/p>\n<h4>Java Serialization<\/h4>\n<p>Serialization in Java is a process of writing the state of an object into a byte stream. We need to convert an object into a byte stream because the byte stream is platform-independent.<\/p>\n<p>So we can use this advantage by serializing an object on one platform and using the byte stream on different platforms. In order to serialize an object, we need to implement the java.io.Serializable interface.<\/p>\n<p>The technique of Serialization in Java is mainly used in technologies like RMI(Remote Method Invocation), EJB(Enterprise Java Beans), JPA(Java Persistence API), and Hibernate, etc.<\/p>\n<p>To serialize an object into a byte stream, we need to call the writeObject() method of the ObjectOutputStream class.<\/p>\n<h4>java.io.Serializable Interface<\/h4>\n<p>The java.io.Serializable is a marker interface that adds a Serializable behavior to a class that implements it.<\/p>\n<h4>ObjectOutputStream class<\/h4>\n<p>The class ObjectInputStream is a high-level stream that contains the methods for serializing an object into a byte stream. The ObjectOutputStream class writes objects and primitive data types to an OutputStream.<\/p>\n<p>The rule is that we can write only that object to the streams that support the java.io.Serializable interface.<\/p>\n<h5>Constructor of ObjectOutputStream class<\/h5>\n<p>We use the constructor of the ObjectOutputStream class that has the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">public ObjectOutputStream(OutputStream output) throws IOException \n{\n      \/\/code\n}\n<\/pre>\n<p>This constructor creates an ObjectOutputStream that writes to the specified OutputStream.<\/p>\n<h5>Important Methods of ObjectOutputStream class<\/h5>\n<p>There are some important methods in the ObjectOutputStream class that help us to serialize an object. These methods are listed in the following table:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>S.N<\/b><\/td>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>1.<\/b><\/td>\n<td><span style=\"font-weight: 400\">public final void <\/span><b>writeObject(Object obj)<\/b><span style=\"font-weight: 400\"> throws IOException {}<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method writes the specified object to the ObjectOutputStream class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>2.<\/b><\/td>\n<td><span style=\"font-weight: 400\">public void <\/span><b>flush()<\/b><span style=\"font-weight: 400\"> throws IOException {}<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method flushes the current output stream object.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>3.<\/b><\/td>\n<td><span style=\"font-weight: 400\">public void <\/span><b>close() <\/b><span style=\"font-weight: 400\">throws IOException {}<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method closes the current output stream object.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Java Serialization Example<\/h4>\n<p>To understand the working of Serialization in java, we will first create a class that implements the Serializable interface. We will create a class Teacher. This class implements the java.io.Serializable interface and has 2 members and one constructor.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.Serializable;  \npublic class Teacher implements Serializable\n{  \nint id;  \n \tString name;  \n \tpublic Teacher(int id, String name)\n{  \n  \t\tthis.id = id;  \n  \t\tthis.name = name;  \n}  \n}  \n<\/pre>\n<p>Now after this, we will serialize the object of the Teacher class. To accomplish this, we will use the writeObject() method of ObjectOutputStream class that is used to serialize the object into a byte stream. We will store the object\u2019s state into a text file myFile.txt.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Serialization-in-Java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78921\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Serialization-in-Java.jpg\" alt=\"Serialization in Java\" width=\"708\" height=\"365\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.*;  \npublic class Serialization\n{  \n \tpublic static void main(String args[])\n{  \n \t\ttry\n{  \n  \t\t\t\/\/Creating the object  of Teacher class\n  \t\t\tTeacher t1 = new Teacher(101,\" John\");  \n\n  \t\t\t\/\/Creating the byte stream and writing the object into a file \n  \t\t\tFileOutputStream file = new FileOutputStream(\"myFile.txt\");  \n\n  \t\t\tObjectOutputStream output = new ObjectOutputStream(file);  \n  \t\t\toutput.writeObject(t1);  \n  \t\t\toutput.flush();  \n  \t\t\t\n\/\/closing the stream  \n  \t\t\toutput.close();  \nSystem.out.println(\"Successfully created a byte stream and written it in the specified file\");  \n  \t\t}\ncatch(Exception e)\n{\nSystem.out.println(e);  \n \t\t} \n} \n}   \n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p>Successfully created a byte stream and written it in the specified file<\/p>\n<h4>Deserialization in Java<\/h4>\n<p>It is the reverse process of Serialization which converts the created byte stream back into the state of the object. The method used to deserialize a byte stream into an object is <strong>readObject()<\/strong> method of <strong>ObjectInputStream class<\/strong>.<\/p>\n<h4>ObjectInputStream class<\/h4>\n<p>An ObjectInputStream is a high-level stream class that contains methods that help us in deserializing a byte stream back to the state of the object. It deserializes the objects and primitive data that are written using an ObjectOutputStream.<\/p>\n<h5>Constructor of ObjectInputStream class<\/h5>\n<p>We use the constructor of the ObjectOutputStream class that has the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">public ObjectInputStream(InputStream in) throws IOException \n{\n  \/\/code\n}\n<\/pre>\n<p>This constructor creates an ObjectInputStream that reads from the specified InputStream.<\/p>\n<h5>Important Methods of ObjectInputStream class<\/h5>\n<p>There are some important methods in the ObjectInputStream class that help us to deserialize an object. These methods are listed in the following table:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>S.N<\/b><\/td>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>1.<\/b><\/td>\n<td><span style=\"font-weight: 400\">public final Object <\/span><b>readObject()<\/b><span style=\"font-weight: 400\"> throws IOException, ClassNotFoundException{}<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method reads an object from the input stream.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>2.<\/b><\/td>\n<td><span style=\"font-weight: 400\">public void <\/span><b>close() <\/b><span style=\"font-weight: 400\">throws IOException {}<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method is used to close the object of\u00a0 ObjectInputStream.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Example of Deserialization<\/h4>\n<p>Now it is the time to convert the byte stream that we created in the previous program into the object.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Deserialization-in-Java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78922\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Deserialization-in-Java.jpg\" alt=\"Deserialization in Java\" width=\"708\" height=\"365\" \/><\/a><\/p>\n<p>Let\u2019s see the code to deserialize an object:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.deserialization;\nimport java.io.*;  \npublic class Deserialization\n{  \n     public static void main(String args[])\n     {\n  \t\ttry\n                {  \n  \t\t\t\/\/Creating stream to read the object  \n                        ObjectInputStream input = new ObjectInputStream(new FileInputStream(\"myFile.txt\"));  \n \t\t\tTeacher teacher = (Teacher)input.readObject();  \n \t\t\t\n                        \/\/printing the data of the serialized object  \n  \t\t\tSystem.out.println(\u201cThe id of the teacher is:\u201d +teacher.id);  \n                        System.out.println(\u201cThe name of the teacher is:\u201d +teacher.name); \n  \t\t\t\n                        \/\/closing the stream  \n  \t\t\tinput.close();  \n  \t\t}\n                catch(Exception e)\n                {\n                        System.out.println(e);\n                }  \n      }  \n}  \n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p>The id of the teacher is: 101<\/p>\n<p>The name of the teacher is: John<\/p>\n<h4>Java Serialization with Inheritance (IS-A Relationship)<\/h4>\n<p>If the parent class implements the Serializable interface, then all its child classes will also be Serializable automatically. To understand this concept, let\u2019s take an example:<\/p>\n<h5>Parent class:<\/h5>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.Serializable;  \nclass Employee implements Serializable\n{  \n      int id;  \n      String name;  \n      Employee(int id, String name) \n      {  \n           this.id = id;  \n           this.name = name;  \n      }  \n}<\/pre>\n<h5>Child class:<\/h5>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nclass Teacher extends Employee\n{  \n     String subjectName;  \n     double salary;  \n     public Teacher(int id, String name, String subjectName, double salary) \n     {  \n                super(id,name);  \n  \t\tthis.subjectName= subjectName;\n \t\tthis.salary = salary;;  \n     }  \n}  \n<\/pre>\n<p>Now we can easily serialize the object of the Teacher class that extends the Employee class. As the Employee class is Serializable, the Teacher class will automatically become Serializable without implementing the Serializable interface.<\/p>\n<h4>Java Serialization with Inheritance (IS-A Relationship)<\/h4>\n<p>If a class refers to another class, then all the references of the classes must be Serializable, otherwise Serialization can not take place. And, unfortunately, a NotSerializableException will be thrown at runtime. Let us learn it with example:<\/p>\n<h5>First Class:<\/h5>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">public class SalaryDetails\n{  \n     String post;\n     double salary;  \n     public Address(String post, double salary)\n     {  \n        \tthis.post = post;\n                this.salary = salary;\n     }  \n}\n<\/pre>\n<h5>Second class:<\/h5>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import java.io.Serializable;  \npublic class Employee implements Serializable\n{  \n        int id;  \n \tString name;  \n        SalaryDetails salary;\t   \/\/HAS-A  relationship\n \tpublic Employee(int id, String name) \n        {  \n \t\tthis.id = id;  \n  \t       \tthis.name = name;  \n        }  \n}  \n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p>Since SalaryDetails is not Serializable, you can not serialize the instance of Employee class.<\/p>\n<h4>Advantages of Serialization<\/h4>\n<p>1. To save\/persist the state of an object.<br \/>\n2. To travel an object across a network.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Advantage-of-Serialization.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-78923 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/05\/Advantage-of-Serialization.jpg\" alt=\"Advantage of Java Serialization\" width=\"719\" height=\"306\" \/><\/a><\/p>\n<h4>Java Serialization with the static data member<\/h4>\n<p>If our class contains any static data member, it will not be serialized because static is the part of the class not the object.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.*;\nclass Student implements Serializable\n{  \n        int id;  \n \tString name;  \n        static String collegename = \"SVV University\";    \/\/We can\u2019t serialize the static member\n \t\n        public Student(int id, String name) \n        {  \n  \t\tthis.id = id;  \n  \t\tthis.name = name;  \n \t}  \n}  \n<\/pre>\n<h4>Java transient Keyword<\/h4>\n<p>There are some cases when you don\u2019t want to serialize any data member of a class but also include it in the code of serialization. In this case, you can mark or declare that member with the transient keyword which will restrict the member from being serialized.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.*;\nclass Student implements Serializable\n{  \n        transient int id;  \t\/\/Making id transient so that it cant be serialized\n \tString name;  \n \t\n        public Student(int id, String name) \n        {  \n  \t\tthis.id = id;  \n  \t\tthis.name = name;  \n \t}  \n}  \n<\/pre>\n<p>Now, the transient member id can not be serialized. When we deserialize the object, then you will get the values of only name or other non-transient members. But the value of id as default will be returned. In our case, it will return 0 as default value as id is of int type.<\/p>\n<h4>SerialVersionUID<\/h4>\n<p>The serialization process at runtime associates an id with each Serializable class which is known as SerialVersionUID. It is used to verify the sender and receiver of the serialized object. The sender and receiver must be the same. To verify it, SerialVersionUID is used.<\/p>\n<p>The sender and receiver must have the same SerialVersionUID, otherwise, InvalidClassException will be thrown when you deserialize the object. We can also declare our own SerialVersionUID in the Serializable class.<\/p>\n<p>To do so, you need to create a field SerialVersionUID and assign a value to it. It must be of the long type with static and final. It is suggested to explicitly declare the serialVersionUID field in the class and have it private also.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">private static final long serialVersionUID=1L;<\/pre>\n<p><strong>Now, the Serializable class will look like this:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.serialization;\nimport java.io.Serializable; \nclass Student implements Serializable\n{\n        private static final long serialVersionUID = 123L;  \n        int id;\n \tString name;  \n \t\n        public Student(int id, String name) \n        {  \n  \t\tthis.id = id;  \n  \t\tthis.name = name;  \n \t}  \n}  \n<\/pre>\n<h3>Conclusion<\/h3>\n<p>Serialization in java and Deserialization in java are very important concepts. These concepts take you one step ahead of being an advanced java developer. This article gave you a complete guide of serializing and deserializing an object.<\/p>\n<p>We need to implement the Serializable interface of the java.io package in order to use Serialization. We also discussed many special cases of Serialization with examples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome back to TechVidvan Java Tutorial series. In our last tutorial, we discussed Packages in Java. In this tutorial, we are going to learn the process of Serialization in Java and Deserialization in Java.&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":78920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[2711,2712,2713,2714,2715],"class_list":["post-78883","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-deserialization-in-java","tag-java-serialization-example","tag-serialization-and-deserialization-in-java","tag-serialization-in-java","tag-serialversionuid"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Serialization in Java - Concept that Cannot be Missed - TechVidvan<\/title>\n<meta name=\"description\" content=\"Serialization in java and Deserialization in java with practical implementation, Methods to serialize &amp; deserialize in java, examples of java serialization\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Serialization in Java - Concept that Cannot be Missed - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Serialization in java and Deserialization in java with practical implementation, Methods to serialize &amp; deserialize in java, examples of java serialization\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-30T04:30:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Serialization in Java - Concept that Cannot be Missed - TechVidvan","description":"Serialization in java and Deserialization in java with practical implementation, Methods to serialize & deserialize in java, examples of java serialization","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Serialization in Java - Concept that Cannot be Missed - TechVidvan","og_description":"Serialization in java and Deserialization in java with practical implementation, Methods to serialize & deserialize in java, examples of java serialization","og_url":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-05-30T04:30:40+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Serialization in Java &#8211; Concept that Cannot be Missed","datePublished":"2020-05-30T04:30:40+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/"},"wordCount":1276,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg","keywords":["Deserialization in Java","java serialization example","Serialization and Deserialization in Java","Serialization in Java","SerialVersionUID"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/","url":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/","name":"Serialization in Java - Concept that Cannot be Missed - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg","datePublished":"2020-05-30T04:30:40+00:00","description":"Serialization in java and Deserialization in java with practical implementation, Methods to serialize & deserialize in java, examples of java serialization","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/05\/Serialization-and-Deserialization-in-Java.jpg","width":802,"height":420,"caption":"Serialization and Deserialization in Java"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/serialization-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Serialization in Java &#8211; Concept that Cannot be Missed"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/78883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=78883"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/78883\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/78920"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=78883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=78883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=78883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}