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

StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?

6 Answers   HCL,


How to retrieve data from database in java using arraylist?

0 Answers  


What is nested interface?

0 Answers  


When do I need to use reflection feature in java?

0 Answers  


Is JRE required to compile Java files ?

4 Answers   HCL,






Do you know why doesn't the java library use a randomized version of quicksort?

0 Answers  


How thread scheduler schedule the task?

0 Answers  


Why all programming languages have main as a execution starting point?

4 Answers  


what are ER diagrams?

2 Answers  


Why java applets are more useful for intranets as compared to internet?

0 Answers  


How can an exception be thrown manually by a programmer?

0 Answers  


What is difference in between java class and bean?

0 Answers  


Categories