About Question enthuware.ocpjp.v8.2.1389 :
Posted: Tue Feb 18, 2020 6:30 am
The question is "Which of the following approaches can be taken independently of each other so that a Portfolio object can be serialized while preserving the state of the Bond objects contained in Portfolio?"
I translate this as: You want to serialize Portfolio objects including their Bonds. Right?
So I would think that the serialized object must contain the field Bond[] bonds. Does an array not support serialization? Why not just serialize this whole field? Or does it then just serialize the references to bonds objects but leaving out the actual objects it is referencing to? But how will the references to those objects get loaded upon deserialization if the array is transient? I might have preserved the bonds objects but I don't know if they where contained in the array. Thanks a lot!
I translate this as: You want to serialize Portfolio objects including their Bonds. Right?
So I would think that the serialized object must contain the field Bond[] bonds. Does an array not support serialization? Why not just serialize this whole field? Or does it then just serialize the references to bonds objects but leaving out the actual objects it is referencing to? But how will the references to those objects get loaded upon deserialization if the array is transient? I might have preserved the bonds objects but I don't know if they where contained in the array. Thanks a lot!