Interview Questions

What is Serialization in .NET?

.NET Interview Questions and Answers


(Continued from previous question...)

68. What is Serialization in .NET?

Anwer1
The serialization is the process of converting the objects into stream of bytes.
they or used for transport the objects(via remoting) and persist objects(via files and databases)

Answer2
When developing smaller applications that do not have a database (or other formal storage mechanism) or data that doesn’t need to be stored in a database (such as the state of a web application), you often still would like to save the data for later retrieval. There are many ways to do this, but many of them are subject to a lot of extra code (work) and extra time spent debugging. With .NET, there is now an easy way to add this functionality to your code with only a few lines of easily tested code. This easy way is called serialization.

Serialization is the process of storing an object, including all of its public and private fields, to a stream. Deserialization is the opposite – restoring an object’s field values from a stream. The stream is generally in the form of a FileStream, but does not have to be. It could be a memory stream or any other object that is of type IO.Stream. The format can be anything from XML to binary to SOAP.

(Continued on next question...)

Other Interview Questions