answersLogoWhite

0

What is serialization in Java?

Updated: 8/9/2023
User Avatar

Wiki User

16y ago

Best Answer

Serialization is the ability to easily store the state of an Object in memory onto some long-term medium (on a hard drive, for example). Basically, the Serializable interface allows us to tell Java to turn our Object into a byte-stream. The Object could be a document that the user is working on, or a more complex data class which needs the ability to be saved to the hard drive. Using the Serializable interface (and related I/O methods), Java will do most of the work for us.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

Serial is a word used to point out something that is consisting of or forming part of something in a series. It also can mean a story or play that is regularly part of a magazine or newspaper.

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

Serialization is taking an Object that has been instantiated in Java and writing it onto a file, usually a ObjectStream.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is serialization in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is meaning Serialize in java?

Primary purpose of java serialization is to write an object into a stream, so that it can be transported through a network and that object can be rebuilt again. When there are two different parties involved, you need a protocol to rebuild the exact same object again. Java serialization API just provides you that. Other ways you can leverage the feature of serialization is, you can use it to perform a deep copy. Why I used 'primary purpose' in the above definition is, sometimes people use java serialization as a replacement for database. Just a placeholder where you can persist an object across sessions. This is not the primary purpose of java serialization. Sometimes, people say that java serialization is used for storing (to preserve the state) an object and retrieving it. They use it synonymously with database. This is a wrong perception for serialization.


What is meaning of word persistence in java?

Persistence is the term used to refer to the situation where the objects data is stored even after the object is destroyed or the application is closed. Persistence is implemented using Serialization where the data of the object is serialized into flat files and stored into the system. These files can be de-serialized to form the objects by using de-serialization.


In Java what does the keyword transient do?

It flags a field as a field that should not be considered part of an object's persistent state. It marks a member variable not to be serialized when it is persisted to streams of bytes. (Using Serialization) When an object is transferred through the network, the object needs to be 'serialized'. Serialization converts the object state to bytes. Those bytes are sent over the network and the object is recreated from those bytes in the target machine. Member variables marked by the java transient keyword are not transferred, they are lost on purpose. Ex: When transmitting user authentication information, password fields are made transient in the models so that, they are not transmitted through the network.


What is serializable class in JAVA?

The serializable interface is used to perform the serialization action. Serialization is the process by which the contents of an object are written to any form of storage - say a flat file. This data stored in the flat file can be de-serialized at any time to create the object. Ex: public class Test implements Serializable { … //lots of code }


What is the process of writing the state of an object to a byte stream called?

This is called serialization.

Related questions

What is deserialization in java?

De-serialization is the opposite process of serialization. This is the process where we convert data that has already been written out onto a stream as part of serialization into Java objects.


What is meaning Serialize in java?

Primary purpose of java serialization is to write an object into a stream, so that it can be transported through a network and that object can be rebuilt again. When there are two different parties involved, you need a protocol to rebuild the exact same object again. Java serialization API just provides you that. Other ways you can leverage the feature of serialization is, you can use it to perform a deep copy. Why I used 'primary purpose' in the above definition is, sometimes people use java serialization as a replacement for database. Just a placeholder where you can persist an object across sessions. This is not the primary purpose of java serialization. Sometimes, people say that java serialization is used for storing (to preserve the state) an object and retrieving it. They use it synonymously with database. This is a wrong perception for serialization.


How is Java persistence done?

Java persistence is implemented using serialization. Serialization is a technique in java using which the contents of a java object (A class instance) can be written into a flat file. This value can be unserialized or deserialized at a later point of time to create the object. Any class that implements the Serializable interface can be serialized.


What is use of serialization in java?

Serialization will turn a Java Object into a text string (representing it's contents) which can be persisted to a storage device or sent over a network. There is an opposite process of turning the text string representation back into an instanciated Object.


What are the Topics under Advanced Java?

Some topics under Advanced Java are: a. Exception Handling b. Threading/Multi-Threading c. Remote Method Invocation d. Serialization e. etc


What is meaning of word persistence in java?

Persistence is the term used to refer to the situation where the objects data is stored even after the object is destroyed or the application is closed. Persistence is implemented using Serialization where the data of the object is serialized into flat files and stored into the system. These files can be de-serialized to form the objects by using de-serialization.


In Java what does the keyword transient do?

It flags a field as a field that should not be considered part of an object's persistent state. It marks a member variable not to be serialized when it is persisted to streams of bytes. (Using Serialization) When an object is transferred through the network, the object needs to be 'serialized'. Serialization converts the object state to bytes. Those bytes are sent over the network and the object is recreated from those bytes in the target machine. Member variables marked by the java transient keyword are not transferred, they are lost on purpose. Ex: When transmitting user authentication information, password fields are made transient in the models so that, they are not transmitted through the network.


Difference between advanced java n j2ee?

J2EE stands for Java 2 Enterprise Edition. It is used to create enterprise class web applications that can be used by large enterprises and corporations. Most websites of major companies are created using j2ee. Some of the technologies used in J2ee are: a. Struts b. Hibernate c. JSP d. Servlets e. Spring f. etc Whereas Advanced Java refers to the advanced topics of java that can be used in regular java programs. Some topics under Advanced Java are: a. Exception Handling b. Threading/Multi-Threading c. Remote Method Invocation d. Serialization e. etc


What is the difference between advanced java J2EE?

J2EE stands for Java 2 Enterprise Edition. It is used to create enterprise class web applications that can be used by large enterprises and corporations. Most websites of major companies are created using j2ee. Some of the technologies used in J2ee are: a. Struts b. Hibernate c. JSP d. Servlets e. Spring f. etc Whereas Advanced Java refers to the advanced topics of java that can be used in regular java programs. Some topics under Advanced Java are: a. Exception Handling b. Threading/Multi-Threading c. Remote Method Invocation d. Serialization e. etc


What is serializable class in JAVA?

The serializable interface is used to perform the serialization action. Serialization is the process by which the contents of an object are written to any form of storage - say a flat file. This data stored in the flat file can be de-serialized at any time to create the object. Ex: public class Test implements Serializable { … //lots of code }


Is surbrec Nora the second out in Engligh?

No it's currently in serialization


What is the course content of core java?

Core Java in itself is an ocean. It contains numerous concepts and areas that can be very useful in software development. The course contents depend on what course you are taking? In general, any core java course would include concepts like: a. Object Oriented concepts like Inheritance, Polymorphism etc b. Strings c. Objects d. Classes & Interfaces e. Threads f. Serialization g. Exception Handling h. Garbage collection etc