How will you override default serialization mechanism in java

Answer Posted / sharmila

Serializable is a marker interface. But you may wish to
control on how an object is serialized instead of using the
default mechanism. In such case add implementations of the
readObject() and/or writeObject() methods to the class being
serialized and override default serialization mechanism.

Also, instead of using Serializable interface,
Externalizable interface can be used

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package is imported by default?

733


What is field name?

679


What is the statements?

697


How do we access static members in java?

723


Print Vertical traversal of a Binary Tree.

681






How to display arraylist values in java?

578


What is operator overloading. Is it is supported in java?

602


What is time complexity algorithm?

646


how to handle exceptions in ejb?

1976


Difference between stack and queue?

666


Name few "optional" classes introduced with java 8 ?

737


How we can generate random numbers in java?

704


What is token in java?

646


Can a static block throw exception?

734


How can we create a synchronized collection from given collection?

703