Interview Questions
Java
java Advanced Interview questions
Java Interview Questions
Java interview questions
Java Interview Questions
Difference between the Serializable and Externalizable interfaces
Serializable | Externalizable |
Uses Java’s default serialization mechanism, which automatically serializes the object’s non-transient and non-static fields. | Gives the programmer control over the serialization process by providing the readExternal and writeExternal methods |
Does not provide control over the serialization process, but it is easier to use. | Allows for a more efficient serialization process, but requires more work on the part of the programmer. |
Meant for default serialization | meant for custom serialization |
Everything taken care by JVM. Programmers does not have control | Every thing taken care by programmer |
In serialization , Whole Object will be serialized and to control serialization, we need to use transient keyword. | Whole object or part of Object can be seriazable. transient keyword will have no effect. |
Serialization class is not required to contain public no argument constructor | Externalizable class must contain public no argument constructor |
To Read, More on Externalizable interface, Please read below:
Comments are closed.