1) Difference between Serializable and Externalizable is that Serializable is a
marker interface i.e. does not contain any method but Externalizable interface
contains two methods writeExternal() and readExternal().
2) Responsibility of Serialization. when a class implements
Serializable interface, default Serialization process gets kicked of and that
takes responsibility of serializing super class state. When any class in Java
implement java.io.Externalizable than its your responsibility to implement
Serialization process i.e. preserving all important information.
3) This difference between Serializable and Externalizable is
performance. You can not do much to improve performance of default
serialization process except reducing number of fields to be serialized by using
transient and static keyword but with Externalizable interface you have full
control over Serialization process.
4) Difference between Serializable and Externalizable interface is
maintenance. When your Java class implements Serializable interface its tied
with default representation which is fragile and easily breakable if structure
of class changes e.g. adding or removing field. By using java.io.Externalizable
interface you can create your own custom binary format for your object.
Core Java Interview Questions
Object Oriented Programming(OOP) Questions and Answers
Collections Interview Questions
Java Exceptions Interview Questions
Java Threads Interview Questions
Collection framework in java interview questions
oops concepts with example in java
Java Serialization Interview Questions
Top 20 Core Java Interview Questions with Answers
String Interview Question in java With Example
synchronization interview questions
Java Reflection Interview question
Java Executor Framework (JDK 1.5) Interview Questions
JDK 1.7 interview Questations and Answers
Java I/O interview question with example