** Dog Size :7, Collar Size :6
Dog 23, collar :99
**** Dog Size :23, Collar Size :99
As you can see in the code initially the collar size is 6 and dog size is 7 follwing which serialization is done. The values of collar size and dog size are then changed to 99 and 23 respectively. After the values are changed, deserialization is being done. When you look at the output you see the values of collar size and dog size are 99 and 23 but when the object was serialized it contained values 6 and 7. How and why is this happening?