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

What does 0 mean in boolean?

542


Where pragma is used?

594


What is the difference between a local variable and an instance variable?

546


What is the purpose of the strictfp keyword?

609


How do you check if a character in a string is a digit or letter?

508






What is final?

603


Can we call the run() method instead of start()?

588


What is treemap in java?

550


Is the milky way in a void?

540


Can an integer be a string?

513


What are decalarations?

636


Why are constructors used?

553


Can an arraylist be empty?

564


Explain the selection sort algorithm and state its time complexity?

605


What is the point of polymorphism java?

539