answersLogoWhite

0

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

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Can you serialize the ArrayList class in Java?

The ArrayList class itself is serializable and will serialize if it contains only serializable objects.If, however, you add non-serializable objects into the list then it will not serialize, but will throw a NotSerializableException.


What in java is not serializable?

Objects that do not implement Serializable.


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 the difference between Serializable and Parcelable Which is the best approach in Android?

"Typically, data must be transferred from one activity to another while designing apps. A related intent object has to include this data. To get the data ready for transfer, certain further steps are needed. The object needs to be parcelable or serializable to accomplish that. Serializable: Serializable is a Java interface that is widely used. With this method, you merely implement the interface to designate a class as serializable, and Java will do the rest. The technique makes use of reflection, and numerous new things are produced. The result is the heavy rubbish collection and subpar performance. Parcelable: An Android-specific interface is called Parcelable. You carry out the serialization by yourself in this method. Because reflection is not employed in this operation, no garbage is produced. Since Parcelable circumvents various issues with the built-in Java serialization mechanism, it is significantly more efficient than Serializable. It is also quicker and produces better - results because it has been tailored for use in the development of Android."


Extension file for Java?

Java source files have the .java extension, compiled Java class files have the .class extension.


The actions in a java class are called?

The actions in a java class are called methods.


Why you start java program by class?

without class non of the folder can run so the java program should start in class we can use the class without object in java


How do you call main class with in main class in java?

We can't call a class. We always call a method in java.


When java uses compiler?

What i know is java we will use compiler when it want to get class file(file with .class extension) from java file(file with .java extension).


What is serialization in Java?

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.


What class begins java class hierarchy?

Class


The top most class in java?

All classes in java must inherit from the Object class