What is difference between compatible and incompatible changes in serialization?



What is difference between compatible and incompatible changes in serialization?..

Answer / javamasque

Compatible changes
Some modifications that happed in serializable class after serialization (written to flat file / DB) but there is no exception during de-serialization is called compatible change. These are as below
1. Addition of new field.
2. Static field became non-static.
3. Transient field became non-transient
4. New super class added in class hierarchy.

Incompatible changes
Some modifications that happed in serializable class after serialization (written to flat file / DB) and there is an exception during de-serialization due to the changes is called incompatible change. These are as below
1. Delete existing field.
2. Non-static field became static.
3. Non-transient field became transient
4. Any super class removed in class hierarchy.
5. Field data type changed.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

How does list work in java?

0 Answers  


What's the base class of all exception classes?

0 Answers  


Can we initialize the final blank variable?

0 Answers  


What is the difference between choice and list?

0 Answers  


What is the life-cycle of an object?

2 Answers   Broadridge, Syntel,






What is the ResourceBundle?

2 Answers   Elementus Technologies,


how can i take the inputs from users in java program?

7 Answers   Wipro,


What is nextline method in java?

0 Answers  


Explain about class in java?

0 Answers  


How does class forname work in java?

0 Answers  


is it possible to add a object in a HASHMAP

6 Answers   HCL,


What is meant by controls and types?

1 Answers  


Categories