What is difference between compatible and incompatible changes in serialization?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is listnode in java?

537


What are data types in programming?

553


What is the difference between math floor and math round?

505


Is an empty arraylist null?

598


Is treeset sorted in java?

585






What is executor memory?

523


What are the types of arrays in java?

561


What are the two ways of implementing multi-threading in java?

816


What is the epoch date?

571


What is null statement?

537


Define nashorn in java8.

570


How will you load a specific locale?

540


Is string a class?

556


Why do we override tostring method in java?

513


What is exception propagation?

593