answersLogoWhite

0

What is serializable class in JAVA?

Updated: 8/11/2023
User Avatar

Wiki User

13y ago

Best Answer

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

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

Wiki User

12y ago

No. The Serializable interface is a marker interface. It does not have any methods that can be used by the programmer. Implementing the interface just signifies that the object under consideration can be serialized and written into a file.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

A Serializable class in Java is one that implements the Serializable interface and can be actually Serialized and saved into a file.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is serializable class in JAVA?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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


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.


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).


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.


What class begins java class hierarchy?

Class


What is the way to get rid of Java lang no class deffound error?

To get rid of the Java lang no class deffound error, one must add the class or .jar file which contains this class into the Java classpath. When a Java class is run from the command line, one must add a dot (.)