What is serialization and deserialization in Java?

Sasi Kanth
Sasi Kanth

Posted On: Dec 17, 2020

 

In Java, serialization is a mechanism to persist java objects in a form of a sequence of bytes that includes the object’s data as well as information about the object’s type and its value. When there is a need to send your data object over a network or to store it in files you can use serialization. In other words, you can say that Serialization is the process for the conversion of an object code into a byte stream. Whereas, Deserialization is the reverse process of serialization, where the byte stream is used to recreate the actual Java object code in memory.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Cognizant Mulesoft Interview Questions

    What is Singleton pattern?

    The singleton pattern is the simplest design pattern that restricts the one instantiation of a class that involves only one object that is responsible to make sure there is no more than one instance. ...

    Cognizant Mulesoft Interview Questions

    How to declare function in dataweave?

    You can declare a function in the header or body of a DataWeave script by using the fun keyword. Declaration of a function in data weave is as follows: fun function_Name(objParameter) = { Variable...

    Cognizant Mulesoft Interview Questions

    What is a middleware?

    Middleware is software that acts as an intermediary between an operating system and software applications, especially on a network. Middleware is generally used for linking various software applicatio...