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

What causes memory leaks in java?

0 Answers  


What is the benefit of using enum to declare a constant?

0 Answers   Aspire, Infogain,


What is stringreader?

0 Answers  


give me the answer of this code class A extnds String This code we can write r not in Java? Explain?

4 Answers  


What are the different types of java?

0 Answers  






class{ ... ... interface myinterface{ ... ... } abstract class{ .. .. } ... .. .. } is this possible to write "Interface and/ or Abstract class inside a class ? if possible whcich one is possible is only interface? is only abstract?

2 Answers   Logica CMG,


how system.out.println() works?

2 Answers  


What does the @override annotation do?

0 Answers  


Can an unreachable object become reachable again?

3 Answers  


Why java does not support pointers?

0 Answers  


What is thread priority?

1 Answers   Tech Mahindra,


What is the difference between a field variable and a local variable?

0 Answers  


Categories